Skip to content

Commit

Permalink
Merge pull request #3284 from samsonasik/optimize-session-foreach
Browse files Browse the repository at this point in the history
optimize Session : use foreach instead of for with count when possible
  • Loading branch information
michalsn authored Jul 12, 2020
2 parents 90a6b6f + edf68d9 commit 748ec9a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions system/Session/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -723,9 +723,9 @@ public function markAsFlashdata($key): bool
{
if (is_array($key))
{
for ($i = 0, $c = count($key); $i < $c; $i ++)
foreach ($key as $sessionKey)
{
if (! isset($_SESSION[$key[$i]]))
if (! isset($_SESSION[$sessionKey]))
{
return false;
}
Expand Down

0 comments on commit 748ec9a

Please sign in to comment.