[DomCrawler] minor performance improvement

This commit is contained in:
Kévin Dunglas 2018-03-11 09:47:41 +01:00 committed by Nicolas Grekas
parent 009b4d216e
commit eead301224

View File

@ -1081,8 +1081,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);