summaryrefslogtreecommitdiffstats
path: root/system/libraries/Cache
diff options
context:
space:
mode:
authorIvan Tcholakov <ivantcholakov@gmail.com>2014-08-18 13:41:49 +0200
committerIvan Tcholakov <ivantcholakov@gmail.com>2014-08-18 13:41:49 +0200
commit73f930214780f975c1afe929dd287e219b291830 (patch)
tree52242d43e8b863b3e140404e2165b509d5804141 /system/libraries/Cache
parentd245f0610cb8dc0f559866a85286b39c35d5d910 (diff)
Cache_redis: Optimizations.
Diffstat (limited to 'system/libraries/Cache')
-rw-r--r--system/libraries/Cache/drivers/Cache_redis.php4
1 files changed, 2 insertions, 2 deletions
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;