Skip to content

Commit

Permalink
optimize Session : use foreach instead of for with count when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Jul 12, 2020
1 parent 0ac618c commit edf68d9
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 edf68d9

Please sign in to comment.