summary refs log tree commit diff
path: root/synapse/storage/state.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-03-23 16:54:59 +0000
committerErik Johnston <erik@matrix.org>2016-03-23 16:54:59 +0000
commit647b041d1af28a04004cda42a354259ef7cdc479 (patch)
treedccf33e860071251238ccdf5c1b6dbab9270e6eb /synapse/storage/state.py
parentMerge pull request #664 from matrix-org/erikj/public_room_list (diff)
parentSimplify intern_dict (diff)
downloadsynapse-647b041d1af28a04004cda42a354259ef7cdc479.tar.xz
Merge pull request #666 from matrix-org/erikj/intern
Intern lots of strings
Diffstat (limited to 'synapse/storage/state.py')
-rw-r--r--synapse/storage/state.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/storage/state.py b/synapse/storage/state.py
index eab2c5a8ce..02cefdff26 100644
--- a/synapse/storage/state.py
+++ b/synapse/storage/state.py
@@ -15,6 +15,7 @@
 
 from ._base import SQLBaseStore
 from synapse.util.caches.descriptors import cached, cachedList
+from synapse.util.caches import intern_string
 
 from twisted.internet import defer
 
@@ -393,7 +394,10 @@ class StateStore(SQLBaseStore):
                     # cache absence of the key, on the assumption that if we've
                     # explicitly asked for some types then we will probably ask
                     # for them again.
-                    state_dict = {key: None for key in types}
+                    state_dict = {
+                        (intern_string(etype), intern_string(state_key)): None
+                        for (etype, state_key) in types
+                    }
                     state_dict.update(results[group])
                     results[group] = state_dict
                 else: