Fabien Potencier 3bc9686dc5 minor #2668 Small optimization for Twig_NodeTraverser::traverseForVisitor (covex-nn)
This PR was merged into the 1.x branch.

Discussion
----------

Small optimization for Twig_NodeTraverser::traverseForVisitor

During traversing a node tree `Twig_NodeTraverser::traverseForVisitor` (`Twig_NodeVisitorInterface::leaveNode`) often returns a same child node (a same object). So, there is no need to set it back to its parent.

This PR adds a check if a child node was changed. With this check a lot of calls to `Twig_Node::setNode` will be skipped.

Closes #2665

Commits
-------

555d01f3 Small optimization for Twig_NodeTraverser::traverseForVisitor
2018-04-01 20:24:34 +02:00
2018-03-20 05:26:35 +01:00
2018-03-25 10:27:41 +02:00
2018-03-25 10:27:41 +02:00

Twig, the flexible, fast, and secure template language for PHP
==============================================================

Twig is a template language for PHP, released under the new BSD license (code
and documentation).

Twig uses a syntax similar to the Django and Jinja template languages which
inspired the Twig runtime environment.

More Information
----------------

Read the `documentation`_ for more information.

.. _documentation: http://twig.sensiolabs.org/documentation
Languages
PHP 99.9%