summaryrefslogtreecommitdiffstats
path: root/lib/private/util.php
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2015-01-14 13:39:29 +0100
committerBernhard Posselt <dev@bernhard-posselt.com>2015-01-14 13:39:29 +0100
commit8cb60b23660c284cf59280e31b1e262dfdb2cf4e (patch)
treeb56265647244eaa91814d7dac2ca241f51218df8 /lib/private/util.php
parent717e3acd9bfa816e7ebe75c1a4d468995eba2acb (diff)
downloadnextcloud-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.php4
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;
}