Skip to content

Commit

Permalink
Don't increment new key when preserveKey
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Mar 6, 2024
1 parent a40d9d4 commit ce993c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Finder.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ public static function rows(iterable $data, callable $filter, bool $preserveKey
continue;
}

if (! is_numeric($key)) {
if ($preserveKey || ! is_numeric($key)) {
$rowKey = $key;
} else {
$rowKey = $preserveKey ? $key : $newKey;
$rowKey = $newKey;
++$newKey;
}

Expand Down

0 comments on commit ce993c4

Please sign in to comment.