fixed lru cache
This commit is contained in:
parent
9c5718a427
commit
e5da826b94
@ -170,7 +170,10 @@ LRUCache.prototype.remove = function(key) {
|
|||||||
entry.older.newer = undefined;
|
entry.older.newer = undefined;
|
||||||
// link the newer entry to head
|
// link the newer entry to head
|
||||||
this.tail = entry.older;
|
this.tail = entry.older;
|
||||||
|
} else {
|
||||||
|
this.head = this.tail = undefined;
|
||||||
}
|
}
|
||||||
|
this.size--;
|
||||||
return entry.value;
|
return entry.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user