projects
/
web/konrad/twig.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
7f70bbf
)
Optimize initGlobals to do only one merge call
author
Jordi Boggiano
<j.boggiano@seld.be>
Sat, 4 May 2013 20:18:16 +0000 (22:18 +0200)
committer
Jordi Boggiano
<j.boggiano@seld.be>
Sat, 4 May 2013 20:18:16 +0000 (22:18 +0200)
lib/Twig/Environment.php
patch
|
blob
|
history
diff --git
a/lib/Twig/Environment.php
b/lib/Twig/Environment.php
index
54df5be
..
eafe02a
100644
(file)
--- a/
lib/Twig/Environment.php
+++ b/
lib/Twig/Environment.php
@@
-1103,11
+1103,13
@@
class Twig_Environment
if (!is_array($extGlob)) {
throw new UnexpectedValueException(sprintf('"%s::getGlobals()" must return an array of globals.', get_class($extension)));
}
-
- $globals = array_merge($globals, $extGlob);
+
+ $globals[] = $extGlob;
}
- return array_merge($globals, $this->staging->getGlobals());
+ $globals[] = $this->staging->getGlobals();
+
+ return call_user_func_array('array_merge', $globals);
}
protected function initExtensions()