projects
/
konrad/twig.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
8651608
)
tweaked For node temporary variable names (closes #42)
author
Fabien Potencier
<fabien.potencier@gmail.com>
Tue, 13 Apr 2010 09:45:01 +0000 (11:45 +0200)
committer
Fabien Potencier
<fabien.potencier@gmail.com>
Tue, 13 Apr 2010 09:45:01 +0000 (11:45 +0200)
lib/Twig/Node/For.php
patch
|
blob
|
history
diff --git
a/lib/Twig/Node/For.php
b/lib/Twig/Node/For.php
index
f2ec43c
..
2d115ea
100644
(file)
--- a/
lib/Twig/Node/For.php
+++ b/
lib/Twig/Node/For.php
@@
-50,6
+50,8
@@
class Twig_Node_For extends Twig_Node implements Twig_NodeListInterface
public function compile($compiler)
{
+ static $i = 0;
+
$compiler
->addDebugInfo($this)
->pushContext()
@@
-69,7
+71,7
@@
class Twig_Node_For extends Twig_Node implements Twig_NodeListInterface
$loopVars = array('_key', $this->item->getName());
}
- $var = rand(1, 999999);
+ $var = $i++;
$compiler
->write("\$seq$var = twig_iterator_to_array(")
->subcompile($this->seq)