From 6d4521e8fecd5b37859685bbb95e1db32b00d1ab Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 26 May 2016 16:36:24 +0200 Subject: [PATCH] Using cached array length in `for` --- .../install/files/lib/system/session/SessionHandler.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.20.1