diff options
author | Lukas Reschke <lukas@owncloud.com> | 2014-10-23 23:27:15 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2014-10-24 12:27:53 +0200 |
commit | d060180140923ac054b252f0cbd821063a53f5b7 (patch) | |
tree | 59d53bb16be35960f493709d8409a75bc79be47e /apps/user_ldap/lib/wizard.php | |
parent | 9739a25547e5f8f7500b0a962780cb9267b47cd1 (diff) | |
download | nextcloud-server-d060180140923ac054b252f0cbd821063a53f5b7.tar.gz nextcloud-server-d060180140923ac054b252f0cbd821063a53f5b7.zip |
Use function outside of loop
Otherwise the function is executed n times which is a lot of overhead
Diffstat (limited to 'apps/user_ldap/lib/wizard.php')
-rw-r--r-- | apps/user_ldap/lib/wizard.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/user_ldap/lib/wizard.php b/apps/user_ldap/lib/wizard.php index e2a85ea5eb9..1d7701440e9 100644 --- a/apps/user_ldap/lib/wizard.php +++ b/apps/user_ldap/lib/wizard.php @@ -685,7 +685,8 @@ class Wizard extends LDAPUtility { $this->ldap->getDN($cr, $er); $attrs = $this->ldap->getAttributes($cr, $er); $result = array(); - for($i = 0; $i < count($possibleAttrs); $i++) { + $possibleAttrsCount = count($possibleAttrs); + for($i = 0; $i < $possibleAttrsCount; $i++) { if(isset($attrs[$possibleAttrs[$i]])) { $result[$possibleAttrs[$i]] = $attrs[$possibleAttrs[$i]]['count']; } |