From 418cadb945fd2c8023f477f68a0dae29ffad5a5a Mon Sep 17 00:00:00 2001 From: mengskysama Date: Mon, 26 Oct 2015 10:57:22 +0800 Subject: [PATCH] Update lru_cache.py --- shadowsocks/lru_cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shadowsocks/lru_cache.py b/shadowsocks/lru_cache.py index 401f19b..e67fdff 100644 --- a/shadowsocks/lru_cache.py +++ b/shadowsocks/lru_cache.py @@ -88,12 +88,12 @@ class LRUCache(collections.MutableMapping): self.close_callback(value) self._closed_values.add(value) 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] del self._keys_to_last_time[key] c += 1 + self._last_visits.popleft() del self._time_to_keys[least] if c: self._closed_values.clear()