Skip to content

Commit

Permalink
Small optimization, single level cache array
Browse files Browse the repository at this point in the history
  • Loading branch information
ggppdk committed Sep 7, 2017
1 parent 85293f1 commit 35afb4c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ public function onCustomFieldsGetTypes()
// Cache filesystem access / checks
static $types_cache = array();

if (isset($types_cache[$this->_type][$this->_name]))
if (isset($types_cache[$this->_type . $this->_name]))
{
return $types_cache[$this->_type][$this->_name];
return $types_cache[$this->_type . $this->_name];
}

$types = array();
Expand Down Expand Up @@ -93,7 +93,7 @@ public function onCustomFieldsGetTypes()
}

// Add to cache
$types_cache[$this->_type][$this->_name] = $types;
$types_cache[$this->_type . $this->_name] = $types;

// Return the data
return $types;
Expand Down

0 comments on commit 35afb4c

Please sign in to comment.