summaryrefslogtreecommitdiffstats
path: root/system/libraries/Cache/Cache.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2015-06-22 12:24:11 +0200
committerAndrey Andreev <narf@devilix.net>2015-06-22 12:24:11 +0200
commit070ce056047f7624ceb95a1da2a34fc96bfa0868 (patch)
tree0f100de11d195b299afd3bf4835dc2402a1dcbf6 /system/libraries/Cache/Cache.php
parent9aade1cd9f666ac0f70c97c4299063fafe68ada8 (diff)
A small optimization in CI_Cache::is_supported()
As it was, the static variable was always re-set to an empty array
Diffstat (limited to 'system/libraries/Cache/Cache.php')
-rw-r--r--system/libraries/Cache/Cache.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/system/libraries/Cache/Cache.php b/system/libraries/Cache/Cache.php
index 215a7c528..06403b6e9 100644
--- a/system/libraries/Cache/Cache.php
+++ b/system/libraries/Cache/Cache.php
@@ -243,14 +243,13 @@ class CI_Cache extends CI_Driver_Library {
*/
public function is_supported($driver)
{
- static $support = array();
+ static $support;
- if ( ! isset($support[$driver]))
+ if ( ! isset($support, $support[$driver]))
{
$support[$driver] = $this->{$driver}->is_supported();
}
return $support[$driver];
}
-
}