From 070ce056047f7624ceb95a1da2a34fc96bfa0868 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 22 Jun 2015 13:24:11 +0300 Subject: A small optimization in CI_Cache::is_supported() As it was, the static variable was always re-set to an empty array --- system/libraries/Cache/Cache.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'system') 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]; } - } -- cgit v1.2.3-24-g4f1b