From: Alexander Ebert Date: Thu, 26 May 2016 14:36:24 +0000 (+0200) Subject: Using cached array length in `for` X-Git-Tag: 3.0.0_Beta_1~1623 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6d4521e8fecd5b37859685bbb95e1db32b00d1ab;p=GitHub%2FWoltLab%2FWCF.git Using cached array length in `for` --- diff --git a/wcfsetup/install/files/lib/system/session/SessionHandler.class.php b/wcfsetup/install/files/lib/system/session/SessionHandler.class.php index b14da1a4ba..d6d9cf768f 100644 --- a/wcfsetup/install/files/lib/system/session/SessionHandler.class.php +++ b/wcfsetup/install/files/lib/system/session/SessionHandler.class.php @@ -887,7 +887,7 @@ class SessionHandler extends SingletonFactory { $data['parentPageID'] = null; $data['parentPageObjectID'] = null; - for ($i = 1; $i < count($pageLocations); $i++) { + for ($i = 1, $length = count($pageLocations); $i < $length; $i++) { if (!empty($pageLocations[$i]['useAsParentLocation'])) { $data['parentPageID'] = $pageLocations[$i]['pageID']; $data['parentPageObjectID'] = ($pageLocations[$i]['pageObjectID'] ?: null);