Skip to content

Commit 2561c6b

Browse files
committed
Move array_merge calls out of loops to improve performance
1 parent 1422e84 commit 2561c6b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Response.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,10 +1048,10 @@ public function getVary(): array
10481048

10491049
$ret = [];
10501050
foreach ($vary as $item) {
1051-
$ret = array_merge($ret, preg_split('/[\s,]+/', $item));
1051+
$ret[] = preg_split('/[\s,]+/', $item);
10521052
}
10531053

1054-
return $ret;
1054+
return array_merge([], ...$ret);
10551055
}
10561056

10571057
/**

0 commit comments

Comments
 (0)