Skip to content

Commit

Permalink
Optimize the retrieval of reserved macro names
Browse files Browse the repository at this point in the history
The list of reserved names does not need to be reset for each template
compilation.
  • Loading branch information
stof committed Aug 17, 2015
1 parent c27b04c commit c267257
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Twig/Parser.php
Expand Up @@ -64,7 +64,7 @@ public function parse(Twig_TokenStream $stream, $test = null, $dropNeedle = fals
{
// push all variables into the stack to keep the current state of the parser
$vars = get_object_vars($this);
unset($vars['stack'], $vars['env'], $vars['handlers'], $vars['visitors'], $vars['expressionParser']);
unset($vars['stack'], $vars['env'], $vars['handlers'], $vars['visitors'], $vars['expressionParser'], $vars['reservedMacroNames']);
$this->stack[] = $vars;

// tag handlers
Expand Down

0 comments on commit c267257

Please sign in to comment.