if _last_visits[index] len > 1
This commit is contained in:
mengskysama 2015-10-26 09:43:48 +08:00
parent 6683dfd3bb
commit 4d24b7477a

View file

@ -87,8 +87,8 @@ class LRUCache(collections.MutableMapping):
if value not in self._closed_values:
self.close_callback(value)
self._closed_values.add(value)
self._last_visits.popleft()
for key in self._time_to_keys[least]:
self._last_visits.popleft()
if key in self._store:
if now - self._keys_to_last_time[key] > self.timeout:
del self._store[key]