Skip to content

Commit

Permalink
Update Cycle operation.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed May 26, 2020
1 parent be33b49 commit 550819b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Operation/Cycle.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ public function on(iterable $collection): Closure
$length = $this->length;

return static function () use ($collection, $length): Generator {
$cycleIterator = new LimitIterator(
$iterator = new LimitIterator(
new InfiniteIterator(
new IterableIterator($collection)
),
0,
$length
);

foreach ($cycleIterator as $value) {
foreach ($iterator as $value) {
yield $value;
}
};
Expand Down

0 comments on commit 550819b

Please sign in to comment.