From c1b18749793d11267c938339ca5c7f58b7f3b453 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 17 May 2007 08:23:15 +0100 Subject: [PATCH] cache_invalidate: fix --- viewfeed.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/viewfeed.js b/viewfeed.js index c3b28bb8..604af1ba 100644 --- a/viewfeed.js +++ b/viewfeed.js @@ -879,13 +879,20 @@ function cache_expire() { function cache_invalidate(id) { var i = 0 - - while (i < article_cache.length) { - if (article_cache[i]["id"] == id) { - article_cache.remove(i); - return true; + + try { + + while (i < article_cache.length) { + if (article_cache[i]["id"] == id) { + debug("cache_invalidate: removed id " + id); + article_cache.splice(i, 1); + return true; + } + i++; } - i++; + debug("cache_invalidate: id not found: " + id); + return false; + } catch (e) { + exception_error("cache_invalidate", e); } - return false; } -- 2.39.5