From 4d24b7477a9b969d9b3f13c8e55fb586cdbf2e7a Mon Sep 17 00:00:00 2001 From: mengskysama Date: Mon, 26 Oct 2015 09:43:48 +0800 Subject: [PATCH] fix bug! if _last_visits[index] len > 1 --- 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..ff4fc7d 100644 --- a/shadowsocks/lru_cache.py +++ b/shadowsocks/lru_cache.py @@ -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]