code: protected function leaveOptimizeFor(Twig_NodeInterface $node, Twig_Environment $env)
      {
          if ($node instanceof Twig_Node_For) {
              array_shift($this->loops);
              array_shift($this->loopsTargets);
              array_shift($this->loopsTargets);
          }
      }
docs: Optimizes "for" tag by removing the "loop" variable creation whenever possible.