From 45c317f83a70895d3fed399a2eaf85caec0c5b09 Mon Sep 17 00:00:00 2001 From: Alexey Kopytko Date: Tue, 24 Oct 2023 09:34:47 +0900 Subject: [PATCH] Avoid array_merge() --- src/Standard.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Standard.php b/src/Standard.php index 69e15b2..4361466 100644 --- a/src/Standard.php +++ b/src/Standard.php @@ -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; @@ -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; }