Use a map to prevent having to use search

This commit is contained in:
Robin Appelman 2014-06-03 12:40:23 +02:00
parent bff9e11ff9
commit 6ed3194863
1 changed files with 2 additions and 4 deletions

View 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]);
}
/**