From: Jordi Boggiano Date: Fri, 13 Apr 2012 13:48:00 +0000 (+0200) Subject: Micro-optimizations X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=c88f8e540e97bbfe03914fbd702b972085aac126;p=web%2Fkonrad%2Ftwig.git Micro-optimizations --- diff --git a/lib/Twig/Extension/Core.php b/lib/Twig/Extension/Core.php index 2b54a5c..82f5706 100644 --- a/lib/Twig/Extension/Core.php +++ b/lib/Twig/Extension/Core.php @@ -986,11 +986,11 @@ else /* used internally */ function twig_ensure_traversable($seq) { - if (is_array($seq) || $seq instanceof Traversable) { + if ($seq instanceof Traversable || is_array($seq)) { return $seq; - } else { - return array(); } + + return array(); } /** @@ -1032,5 +1032,5 @@ function twig_test_empty($value) */ function twig_test_traversable($value) { - return is_array($value) || $value instanceof Traversable; + return $value instanceof Traversable || is_array($value); }