Permalink
Browse files

Decremet itemCount when an item is removed

  • Loading branch information...
1 parent 3e23b1a commit b02186edc60055abcbd0060a94290e60ded2ae76 Satheesh Natesan committed with Jan 3, 2013
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/lru-cache.js
View
@@ -220,6 +220,7 @@ function LRUCache (options) {
var hit = lruList[k]
if (dispose) dispose(hit.key, hit.value)
length -= hit.length
+ itemCount --
delete cache[ hit.key ]
delete lruList[k]
}

0 comments on commit b02186e

Please sign in to comment.