Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Nov 22, 2024
1 parent e8fe4a1 commit 97ef15c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Runtime/LoopIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,9 @@ public function __construct($seq)
$seq = $seq->getIterator();
} while ($seq instanceof \IteratorAggregate);
$this->seq = $seq;
} elseif ($seq instanceof \Iterator) {
$this->seq = $seq;
} elseif (is_iterable($seq)) {
$this->seq = new \IteratorIterator($seq);
/** @var \Iterator<TKey, TValue> $seq */
$this->seq = $seq;
} else {
$this->seq = new \EmptyIterator();
}
Expand Down

0 comments on commit 97ef15c

Please sign in to comment.