Skip to content

Commit

Permalink
Avoid array_merge()
Browse files Browse the repository at this point in the history
  • Loading branch information
sanmai committed Oct 24, 2023
1 parent c48f45c commit 45c317f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Standard.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
use function array_filter;
use function array_flip;
use function array_map;
use function array_merge;
use function array_reduce;
use function array_shift;
use function array_slice;
Expand Down Expand Up @@ -190,7 +189,15 @@ private function join(iterable $left, iterable $right): self
{
// We got two arrays, that's what we will use.
if (is_array($left) && is_array($right)) {
$this->pipeline = array_merge($left, $right);
$this->pipeline = [];

foreach ($left as $key => $value) {
$this->pipeline[$key] = $value;
}

foreach ($right as $key => $value) {
$this->pipeline[$key] = $value;
}

return $this;
}
Expand Down

0 comments on commit 45c317f

Please sign in to comment.