diff options
author | Robin Appelman <icewind@owncloud.com> | 2016-01-03 16:53:44 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-01-11 11:59:24 +0100 |
commit | a3cbdcf202ee1b28fb3109c91e4d32194bdeebb6 (patch) | |
tree | b3690da1941b669b5f070927f70ea0fa7ab5caf7 /lib/private | |
parent | ae7c49f93c7de919d0859abb5c75695c194dd2ff (diff) | |
download | nextcloud-server-a3cbdcf202ee1b28fb3109c91e4d32194bdeebb6.tar.gz nextcloud-server-a3cbdcf202ee1b28fb3109c91e4d32194bdeebb6.zip |
Faster AppConfig->getValues
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/appconfig.php | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/private/appconfig.php b/lib/private/appconfig.php index d1c1e4bfc45..17e474bd77d 100644 --- a/lib/private/appconfig.php +++ b/lib/private/appconfig.php @@ -251,14 +251,13 @@ class AppConfig implements IAppConfig { if ($key === false) { return $this->getAppValues($app); } else { - $configs = []; - foreach ($this->getApps() as $appId) { - if ($this->hasKey($appId, $key)) { - $configs[$appId] = $this->getValue($appId, $key); - } - } + $appIds = $this->getApps(); + $values = array_map(function($appId) use ($key) { + return isset($this->cache[$appId][$key]) ? $this->cache[$appId][$key] : null; + }, $appIds); + $result = array_combine($appIds, $values); - return $configs; + return array_filter($result); } } |