[FIX] core: correct LRU cleaning
Do not change dictionary size since during iteration
This commit is contained in:
parent
14fd77c132
commit
3171fd472e
|
@ -123,7 +123,7 @@ class LRU(object):
|
|||
def clear_prefix(self, prefix):
|
||||
""" Remove from `self` all the items with the given `prefix`. """
|
||||
n = len(prefix)
|
||||
for key in self.iterkeys():
|
||||
for key in self.keys():
|
||||
if key[:n] == prefix:
|
||||
del self[key]
|
||||
|
||||
|
|
Loading…
Reference in New Issue