projects
/
web/konrad/twig.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
70cca66
)
Micro-optimizations
author
Jordi Boggiano
<j.boggiano@seld.be>
Fri, 13 Apr 2012 13:48:00 +0000 (15:48 +0200)
committer
Jordi Boggiano
<j.boggiano@seld.be>
Fri, 13 Apr 2012 13:48:00 +0000 (15:48 +0200)
lib/Twig/Extension/Core.php
patch
|
blob
|
history
diff --git
a/lib/Twig/Extension/Core.php
b/lib/Twig/Extension/Core.php
index
2b54a5c
..
82f5706
100644
(file)
--- 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);
}