MDL-41558 cache: Improve performance of cache::make() by using isset instead of array_key_exist()
This commit is contained in:
Vendored
+2
-2
@@ -173,7 +173,7 @@ class cache_factory {
|
||||
*/
|
||||
public function create_cache_from_definition($component, $area, array $identifiers = array(), $aggregate = null) {
|
||||
$definitionname = $component.'/'.$area;
|
||||
if (array_key_exists($definitionname, $this->cachesfromdefinitions)) {
|
||||
if (isset($this->cachesfromdefinitions[$definitionname])) {
|
||||
$cache = $this->cachesfromdefinitions[$definitionname];
|
||||
$cache->set_identifiers($identifiers);
|
||||
return $cache;
|
||||
@@ -368,7 +368,7 @@ class cache_factory {
|
||||
if ($aggregate) {
|
||||
$id .= '::'.$aggregate;
|
||||
}
|
||||
if (!array_key_exists($id, $this->definitions)) {
|
||||
if (!isset($this->definitions[$id])) {
|
||||
// This is the first time this definition has been requested.
|
||||
if ($this->is_initialising()) {
|
||||
// We're initialising the cache right now. Don't try to create another config instance.
|
||||
|
||||
Reference in New Issue
Block a user