From c90b3ec97ab825dc1d817c3fbcab40e9f8e0c79c Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 23 Nov 2011 15:18:40 +0100 Subject: [PATCH] made a small speed optimization --- lib/Twig/Template.php | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/lib/Twig/Template.php b/lib/Twig/Template.php index 0e20512..c4dfedf 100644 --- a/lib/Twig/Template.php +++ b/lib/Twig/Template.php @@ -375,9 +375,7 @@ abstract class Twig_Template implements Twig_TemplateInterface // object method if (!isset(self::$cache[$class]['methods'])) { - foreach (get_class_methods($object) as $method) { - self::$cache[$class]['methods'][strtolower($method)] = true; - } + self::$cache[$class]['methods'] = array_change_key_case(array_flip(get_class_methods($object))); } $lcItem = strtolower($item); -- 1.7.2.5