Skip to content

Commit

Permalink
perf(Core): use foreach instead of the each() function for better per…
Browse files Browse the repository at this point in the history
…formance
  • Loading branch information
kilofox committed Aug 17, 2023
1 parent 91fddd9 commit af20ac8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions system/classes/Kohana/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,8 @@ public function cookie($key = null, $value = null)

// Handle the set cookie calls
if (is_array($key)) {
reset($key);
while (list($_key, $_value) = each($key)) {
$this->cookie($_key, $_value);
foreach ($key as $k => $v) {
$this->cookie($k, $v);
}
} else {
if (!is_array($value)) {
Expand Down

0 comments on commit af20ac8

Please sign in to comment.