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:13:05 +0000
committerErik Johnston <erik@matrix.org>2016-03-23 16:25:54 +0000
commitacdfef7b1443a8260c43e31e9944b74dfdf286dc (patch)
treecba181b0c3da5e0b53e76e45e71bbba510c09f15 /synapse/storage/state.py
parentIntern sender, event_id and room_id in events (diff)
downloadsynapse-acdfef7b1443a8260c43e31e9944b74dfdf286dc.tar.xz
Intern all the things
Diffstat (limited to 'synapse/storage/state.py')
-rw-r--r--synapse/storage/state.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/synapse/storage/state.py b/synapse/storage/state.py
index 1982b1c607..03eecbbbb6 100644
--- a/synapse/storage/state.py
+++ b/synapse/storage/state.py
@@ -156,9 +156,7 @@ class StateStore(SQLBaseStore):
 
     @defer.inlineCallbacks
     def get_current_state_for_key(self, room_id, event_type, state_key):
-        event_ids = yield self._get_current_state_for_key(
-            room_id, intern_string(event_type), intern_string(state_key)
-        )
+        event_ids = yield self._get_current_state_for_key(room_id, event_type, state_key)
         events = yield self._get_events(event_ids, get_prev_content=False)
         defer.returnValue(events)
 
@@ -205,7 +203,7 @@ class StateStore(SQLBaseStore):
 
             results = {}
             for row in rows:
-                key = (intern_string(row["type"]), intern_string(row["state_key"]))
+                key = (row["type"], row["state_key"])
                 results.setdefault(row["state_group"], {})[key] = row["event_id"]
             return results
 
@@ -286,7 +284,9 @@ class StateStore(SQLBaseStore):
             desc="_get_state_group_for_events",
         )
 
-        defer.returnValue({row["event_id"]: row["state_group"] for row in rows})
+        defer.returnValue({
+            intern(row["event_id"].encode('ascii')): row["state_group"] for row in rows
+        })
 
     def _get_some_state_from_cache(self, group, types):
         """Checks if group is in cache. See `_get_state_for_groups`