diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-01-14 13:39:29 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-01-14 13:39:29 +0100 |
commit | 8cb60b23660c284cf59280e31b1e262dfdb2cf4e (patch) | |
tree | b56265647244eaa91814d7dac2ca241f51218df8 /lib/private/util.php | |
parent | 717e3acd9bfa816e7ebe75c1a4d468995eba2acb (diff) | |
download | nextcloud-server-8cb60b23660c284cf59280e31b1e262dfdb2cf4e.tar.gz nextcloud-server-8cb60b23660c284cf59280e31b1e262dfdb2cf4e.zip |
make translation lookup faster (O(n) -> O(1))
Diffstat (limited to 'lib/private/util.php')
-rw-r--r-- | lib/private/util.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/util.php b/lib/private/util.php index 2f2d7fb9ed3..5db33776173 100644 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -365,9 +365,9 @@ class OC_Util { if (!in_array($path, self::$scripts)) { // load javascript translations if it is the first time an app's // script is loaded. - if (!in_array($application, self::$loadedScriptTranslations)) { + if (!isset(self::$loadedScriptTranslations[$application])) { self::addTranslations($application); - self::$loadedScriptTranslations[] = $application; + self::$loadedScriptTranslations[$application] = true; } self::$scripts[] = $path; } |