symfony/symfony — pull request #9651 by fabpot (2013-11-29 05:57:27+00:00)
Title: Fix `extract` method to avoid recalculating count() for each iteration.

This PR was submitted on the symfony/DomCrawler read-only repository and moved automatically to the main Symfony repository (closes symfony/DomCrawler#16).

Cache the value of `count($attributes)` to avoid recalculating it for each iteration of the loop.

Since this count will never change during the method execution, this change make the code a bit more efficient.