diff options
Diffstat (limited to 'synapse/util/caches')
-rw-r--r-- | synapse/util/caches/treecache.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/util/caches/treecache.py b/synapse/util/caches/treecache.py index 2d014e1f92..3b58860910 100644 --- a/synapse/util/caches/treecache.py +++ b/synapse/util/caches/treecache.py @@ -13,6 +13,9 @@ class TreeCache(object): def __setitem__(self, key, value): return self.set(key, value) + def __contains__(self, key): + return self.get(key, SENTINEL) is not SENTINEL + def set(self, key, value): node = self.root for k in key[:-1]: |