diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2017-10-19 11:03:31 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2017-10-19 11:03:31 +0200 |
commit | a6760560c6c6501c5dea3833ffb52a635ef1f621 (patch) | |
tree | 65bf07cec0fdf327c15db6b20646b5f797135d84 /apps | |
parent | 07b6e234bd3ba015809d9e4a312259266370d985 (diff) | |
download | nextcloud-server-a6760560c6c6501c5dea3833ffb52a635ef1f621.tar.gz nextcloud-server-a6760560c6c6501c5dea3833ffb52a635ef1f621.zip |
Do not check existance before fetch
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/user_ldap/lib/Proxy.php | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/apps/user_ldap/lib/Proxy.php b/apps/user_ldap/lib/Proxy.php index 96bb670b789..805348e7775 100644 --- a/apps/user_ldap/lib/Proxy.php +++ b/apps/user_ldap/lib/Proxy.php @@ -169,24 +169,17 @@ abstract class Proxy { * @return mixed|null */ public function getFromCache($key) { - if(is_null($this->cache) || !$this->isCached($key)) { + if($this->cache === null) { return null; } - $key = $this->getCacheKey($key); - - return json_decode(base64_decode($this->cache->get($key))); - } - /** - * @param string $key - * @return bool - */ - public function isCached($key) { - if(is_null($this->cache)) { - return false; - } $key = $this->getCacheKey($key); - return $this->cache->hasKey($key); + $value = $this->cache->get($key); + if ($value === null) { + return null; + } + + return json_decode(base64_decode($value)); } /** |