From e5da826b94cca540b83937712b35405f5a098d13 Mon Sep 17 00:00:00 2001 From: javi Date: Fri, 21 Oct 2011 17:41:41 +0200 Subject: [PATCH] fixed lru cache --- lib/cartodb/lru.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/cartodb/lru.js b/lib/cartodb/lru.js index 5539adc6..adb8a8f5 100644 --- a/lib/cartodb/lru.js +++ b/lib/cartodb/lru.js @@ -170,7 +170,10 @@ LRUCache.prototype.remove = function(key) { entry.older.newer = undefined; // link the newer entry to head this.tail = entry.older; + } else { + this.head = this.tail = undefined; } + this.size--; return entry.value; } @@ -246,4 +249,4 @@ LRUCache.prototype.toString = function() { // Export ourselves //if (typeof this === 'object') this.LRUCache = LRUCache; -module.exports = LRUCache; \ No newline at end of file +module.exports = LRUCache;