summary refs log tree commit diff
path: root/synapse/storage/_base.py
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <paul@matrix.org>2015-02-23 18:29:26 +0000
committerPaul "LeoNerd" Evans <paul@matrix.org>2015-02-23 18:30:45 +0000
commitf53fcbce9789186c1c42fe2f93ba46e3d8720b1b (patch)
tree9d6e2f46a79a3cce0ef73b52509f9a2a7865375f /synapse/storage/_base.py
parentFix code style warning (diff)
downloadsynapse-f53fcbce9789186c1c42fe2f93ba46e3d8720b1b.tar.xz
Use cache.pop() instead of a separate membership test + del []
Diffstat (limited to 'synapse/storage/_base.py')
-rw-r--r--synapse/storage/_base.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/synapse/storage/_base.py b/synapse/storage/_base.py
index 42edb56c36..da698cb3b8 100644
--- a/synapse/storage/_base.py
+++ b/synapse/storage/_base.py
@@ -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