From c88f8e540e97bbfe03914fbd702b972085aac126 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 13 Apr 2012 15:48:00 +0200 Subject: [PATCH] Micro-optimizations --- lib/Twig/Extension/Core.php | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) 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); } -- 1.7.2.5