minor #26423 [DomCrawler] minor performance improvement (dunglas)
This PR was squashed before being merged into the 4.1-dev branch (closes #26423).
Discussion
----------
[DomCrawler] minor performance improvement
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? |no <!-- don't forget to update UPGRADE-*.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | n/a
Commits
-------
eead301
[DomCrawler] minor performance improvement
This commit is contained in:
commit
3e999880ed
@ -1080,8 +1080,9 @@ class Crawler implements \Countable, \IteratorAggregate
|
||||
{
|
||||
$nodes = array();
|
||||
|
||||
$currentNode = $this->getNode(0);
|
||||
do {
|
||||
if ($node !== $this->getNode(0) && 1 === $node->nodeType) {
|
||||
if ($node !== $currentNode && XML_ELEMENT_NODE === $node->nodeType) {
|
||||
$nodes[] = $node;
|
||||
}
|
||||
} while ($node = $node->$siblingDir);
|
||||
|
Reference in New Issue
Block a user