From 73f930214780f975c1afe929dd287e219b291830 Mon Sep 17 00:00:00 2001 From: Ivan Tcholakov Date: Mon, 18 Aug 2014 14:41:49 +0300 Subject: Cache_redis: Optimizations. --- system/libraries/Cache/drivers/Cache_redis.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/libraries/Cache/drivers/Cache_redis.php') diff --git a/system/libraries/Cache/drivers/Cache_redis.php b/system/libraries/Cache/drivers/Cache_redis.php index 9cb789eb0..4a8ad5d67 100644 --- a/system/libraries/Cache/drivers/Cache_redis.php +++ b/system/libraries/Cache/drivers/Cache_redis.php @@ -102,7 +102,7 @@ class CI_Cache_redis extends CI_Driver { $data = serialize($data); - if (($index_key = array_search($id, $this->_serialized, TRUE)) === FALSE) + if (! in_array($id, $this->_serialized, TRUE)) { $this->_serialized[] = $id; } @@ -130,7 +130,7 @@ class CI_Cache_redis extends CI_Driver */ public function delete($key) { - if ($this->_redis->delete($key) === 1 && array_search($key, $this->_serialized, TRUE) !== FALSE) + if ($this->_redis->delete($key) === 1 && in_array($key, $this->_serialized, TRUE)) { $this->_redis->sRemove('_ci_redis_serialized', $key); return TRUE; -- cgit v1.2.3-24-g4f1b