From 66e110812068efcda0e45ca726b70532af6bb724 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Tue, 11 Dec 2018 19:24:34 +0100 Subject: [PATCH] Use iterator_count(). --- src/Node/Node.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Node/Node.php b/src/Node/Node.php index 25d2b3e..2282fff 100644 --- a/src/Node/Node.php +++ b/src/Node/Node.php @@ -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()); } }