cached id streams can be empty, compare against false

This commit is contained in:
Evan Prodromou 2010-01-04 10:03:57 -10:00
parent 254ea279d8
commit 06b6a27d7d
1 changed files with 3 additions and 3 deletions

View File

@ -1207,7 +1207,7 @@ class Notice extends Memcached_DataObject
$idstr = $cache->get($idkey); $idstr = $cache->get($idkey);
if (!empty($idstr)) { if ($idstr !== false) {
// Cache hit! Woohoo! // Cache hit! Woohoo!
$window = explode(',', $idstr); $window = explode(',', $idstr);
$ids = array_slice($window, $offset, $limit); $ids = array_slice($window, $offset, $limit);
@ -1216,7 +1216,7 @@ class Notice extends Memcached_DataObject
$laststr = $cache->get($idkey.';last'); $laststr = $cache->get($idkey.';last');
if (!empty($laststr)) { if ($laststr !== false) {
$window = explode(',', $laststr); $window = explode(',', $laststr);
$last_id = $window[0]; $last_id = $window[0];
$new_ids = call_user_func_array($fn, array_merge($args, array(0, NOTICE_CACHE_WINDOW, $new_ids = call_user_func_array($fn, array_merge($args, array(0, NOTICE_CACHE_WINDOW,
@ -1376,7 +1376,7 @@ class Notice extends Memcached_DataObject
$ids = $this->_repeatStreamDirect($limit); $ids = $this->_repeatStreamDirect($limit);
} else { } else {
$idstr = $cache->get(common_cache_key('notice:repeats:'.$this->id)); $idstr = $cache->get(common_cache_key('notice:repeats:'.$this->id));
if (!empty($idstr)) { if ($idstr !== false) {
$ids = explode(',', $idstr); $ids = explode(',', $idstr);
} else { } else {
$ids = $this->_repeatStreamDirect(100); $ids = $this->_repeatStreamDirect(100);