From 6ed319486387e6b7a80c64409527c7d454d3509d Mon Sep 17 00:00:00 2001
From: Robin Appelman <icewind@owncloud.com>
Date: Tue, 3 Jun 2014 12:40:23 +0200
Subject: [PATCH] Use a map to prevent having to use search

---
 lib/private/appconfig.php | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/lib/private/appconfig.php b/lib/private/appconfig.php
index cfb2addc4c..f20c4a0842 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]);
 	}
 
 	/**
-- 
GitLab