From e48ca9291421ff5702996c5b10e976200b74406a Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 14 Jul 2011 12:53:18 -0400 Subject: [PATCH] Don't get crud for Notice::repeatStream() --- classes/Notice.php | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/classes/Notice.php b/classes/Notice.php index 517fb01be2..4476798661 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -1861,7 +1861,11 @@ class Notice extends Memcached_DataObject } else { $idstr = $cache->get(Cache::key('notice:repeats:'.$this->id)); if ($idstr !== false) { - $ids = explode(',', $idstr); + if (empty($idstr)) { + $ids = array(); + } else { + $ids = explode(',', $idstr); + } } else { $ids = $this->_repeatStreamDirect(100); $cache->set(Cache::key('notice:repeats:'.$this->id), implode(',', $ids)); @@ -1890,18 +1894,7 @@ class Notice extends Memcached_DataObject $notice->limit(0, $limit); } - $ids = array(); - - if ($notice->find()) { - while ($notice->fetch()) { - $ids[] = $notice->id; - } - } - - $notice->free(); - $notice = NULL; - - return $ids; + return $notice->fetchAll('id'); } function locationOptions($lat, $lon, $location_id, $location_ns, $profile = null) -- 2.39.5