summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2020-11-02 15:02:04 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2020-11-02 15:02:04 +0100
commit441a3434f37ecd96e0aaec03dd854aeb73b0d1fe (patch)
tree3b1032a24679d7c352e0e883a5c69147d9948741 /lib
parentff08b10a897f059adbd30b61e6f4ba1e9af7b719 (diff)
downloadnextcloud-server-441a3434f37ecd96e0aaec03dd854aeb73b0d1fe.tar.gz
nextcloud-server-441a3434f37ecd96e0aaec03dd854aeb73b0d1fe.zip
Move localecache to array
It seems the DS Set in the polyfill implementation is a lot less efficient than normal arrays. (A LOT!). So for now use a stupid normal array. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/L10N/Factory.php12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/private/L10N/Factory.php b/lib/private/L10N/Factory.php
index b807f5cb63f..9c9a3cc951e 100644
--- a/lib/private/L10N/Factory.php
+++ b/lib/private/L10N/Factory.php
@@ -37,7 +37,6 @@
namespace OC\L10N;
-use Ds\Set;
use OCP\IConfig;
use OCP\IRequest;
use OCP\IUser;
@@ -65,9 +64,9 @@ class Factory implements IFactory {
protected $availableLanguages = [];
/**
- * @var Set
+ * @var array
*/
- protected $localeCache;
+ protected $localeCache = [];
/**
* @var array
@@ -110,7 +109,6 @@ class Factory implements IFactory {
$this->request = $request;
$this->userSession = $userSession;
$this->serverRoot = $serverRoot;
- $this->localeCache = new Set();
}
/**
@@ -398,14 +396,14 @@ class Factory implements IFactory {
return true;
}
- if ($this->localeCache->isEmpty()) {
+ if ($this->localeCache === []) {
$locales = $this->findAvailableLocales();
foreach ($locales as $l) {
- $this->localeCache->add($l['code']);
+ $this->localeCache[$l['code']] = true;
}
}
- return $this->localeCache->contains($locale);
+ return isset($this->localeCache[$locale]);
}
/**