Skip to content

Commit 1119d7c

Browse files
committed
perf: avoid recursivity
1 parent a5c3e52 commit 1119d7c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/InfiniteIteratorAggregate.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ public function __construct(Iterator $iterator)
3434
*/
3535
public function getIterator(): Generator
3636
{
37-
yield from $this->iterator;
38-
39-
yield from $this->getIterator();
37+
while (true) {
38+
yield from $this->iterator;
39+
}
4040
}
4141
}

0 commit comments

Comments
 (0)