]> source.dussan.org Git - nextcloud-server.git/commitdiff
Use a map to prevent having to use search
authorRobin Appelman <icewind@owncloud.com>
Tue, 3 Jun 2014 10:40:23 +0000 (12:40 +0200)
committerRobin Appelman <icewind@owncloud.com>
Tue, 3 Jun 2014 10:40:23 +0000 (12:40 +0200)
lib/private/appconfig.php

index cfb2addc4c32d948c5d7d09c8d53183336bb6b8c..f20c4a08426d06df32a097960929674003b654c6 100644 (file)
@@ -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]);
        }
 
        /**