diff --git a/src/Operation/Window.php b/src/Operation/Window.php index 01121f5e9..39d1584d3 100644 --- a/src/Operation/Window.php +++ b/src/Operation/Window.php @@ -40,14 +40,10 @@ static function (Iterator $iterator) use ($size): Generator { ++$size; $size *= -1; - /** @psalm-var list $stack */ $stack = []; foreach ($iterator as $key => $current) { - // @todo Should we use Pack ? - $stack[$key] = $current; - - yield $key => $stack = array_slice($stack, $size); + yield $key => $stack = array_slice([...$stack, $current], $size); } }; }