Browse Source

lint code

auth
clowwindy 10 years ago
parent
commit
e1f2046229
  1. 4
      shadowsocks/lru_cache.py

4
shadowsocks/lru_cache.py

@ -86,13 +86,13 @@ class LRUCache(collections.MutableMapping):
break break
if self.close_callback is not None: if self.close_callback is not None:
for key in self._time_to_keys[least]: for key in self._time_to_keys[least]:
if self._store.__contains__(key): if key in self._store:
if now - self._keys_to_last_time[key] > self.timeout: if now - self._keys_to_last_time[key] > self.timeout:
value = self._store[key] value = self._store[key]
self.close_callback(value) self.close_callback(value)
for key in self._time_to_keys[least]: for key in self._time_to_keys[least]:
self._last_visits.popleft() self._last_visits.popleft()
if self._store.__contains__(key): if key in self._store:
if now - self._keys_to_last_time[key] > self.timeout: if now - self._keys_to_last_time[key] > self.timeout:
del self._store[key] del self._store[key]
del self._keys_to_last_time[key] del self._keys_to_last_time[key]

Loading…
Cancel
Save