Skip to content

Commit

Permalink
Use iterator_count().
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Dec 11, 2018
1 parent cbc2219 commit 66e1108
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Node/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,6 @@ public function withChildren(NodeInterface ...$nodes): NodeInterface
*/
public function depth(): int
{
return \count(\iterator_to_array($this->getAncestors()));
return \iterator_count($this->getAncestors());
}
}

0 comments on commit 66e1108

Please sign in to comment.