From: Robin Appelman Date: Tue, 3 Jun 2014 10:40:23 +0000 (+0200) Subject: Use a map to prevent having to use search X-Git-Tag: v7.0.0alpha2~136^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6ed319486387e6b7a80c64409527c7d454d3509d;p=nextcloud-server.git Use a map to prevent having to use search --- diff --git a/lib/private/appconfig.php b/lib/private/appconfig.php index cfb2addc4c3..f20c4a08426 100644 --- a/lib/private/appconfig.php +++ b/lib/private/appconfig.php @@ -196,7 +196,7 @@ class AppConfig implements \OCP\IAppConfig { $this->cache[$app] = array(); } if (is_array($this->apps) and array_search($app, $this->apps) === false) { - $this->apps[] = $app; + $this->apps[$app] = $app; } $this->cache[$app][$key] = $value; } @@ -233,9 +233,7 @@ class AppConfig implements \OCP\IAppConfig { ); $this->conn->delete('*PREFIX*appconfig', $where); unset($this->cache[$app]); - if (is_array($this->apps) and $i = array_search($app, $this->apps) !== false) { - unset($this->apps[$i]); - } + unset($this->apps[$app]); } /**