Skip to content

Commit

Permalink
Don't use global tap helper (#41326)
Browse files Browse the repository at this point in the history
  • Loading branch information
JosephSilber committed Mar 3, 2022
1 parent 99b04f5 commit 44dc37a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Collections/LazyCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ public function sliding($size = 2, $step = 1)
$chunk[$iterator->key()] = $iterator->current();

if (count($chunk) == $size) {
yield tap(new static($chunk), function () use (&$chunk, $step) {
yield (new static($chunk))->tap(function () use (&$chunk, $step) {
$chunk = array_slice($chunk, $step, null, true);
});

Expand Down

0 comments on commit 44dc37a

Please sign in to comment.