Use cache.pop() instead of a separate membership test + del []

This commit is contained in:
Paul "LeoNerd" Evans 2015-02-23 18:29:26 +00:00
parent 27080698e7
commit f53fcbce97
2 changed files with 8 additions and 2 deletions

View file

@ -75,8 +75,7 @@ def cached(max_entries=1000):
defer.returnValue(ret)
def invalidate(key):
if key in cache:
del cache[key]
cache.pop(key, None)
wrapped.invalidate = invalidate
wrapped.prefill = prefill