8000 [DomCrawler] minor performance improvement · src-run/symfony@eead301 · GitHub
[go: up one dir, main page]

Skip to content

Commit eead301

Browse files
dunglasnicolas-grekas
authored andcommitted
[DomCrawler] minor performance improvement
1 parent 009b4d2 commit eead301

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Symfony/Component/DomCrawler/Crawler.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1081,8 +1081,9 @@ protected function sibling($node, $siblingDir = 'nextSibling')
10811081
{
10821082
$nodes = array();
10831083

1084+
$currentNode = $this->getNode(0);
10841085
do {
1085-
if ($node !== $this->getNode(0) && 1 === $node->nodeType) {
1086+
if ($node !== $currentNode && XML_ELEMENT_NODE === $node->nodeType) {
10861087
$nodes[] = $node;
10871088
}
10881089
} while ($node = $node->$siblingDir);

0 commit comments

Comments
 (0)
0