summary refs log tree commit diff
path: root/synapse/events/snapshot.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2022-01-21 09:10:01 +0000
committerGitHub <noreply@github.com>2022-01-21 09:10:01 +0000
commitc027bc0e4b071d3d40c7b0c1e7011ad5c8c3d0a0 (patch)
tree6970cd33219f8ba74913b85d9f1830552c0f1aa6 /synapse/events/snapshot.py
parentMake the `get_global_account_data_by_type_for_user` cache be a tree-cache who... (diff)
downloadsynapse-c027bc0e4b071d3d40c7b0c1e7011ad5c8c3d0a0.tar.xz
Add `FrozenEvent.get_state_key` and use it in a couple of places (#11793)
This is more efficient, since we only have to look up `state_key` in the event
dict once, rather than three (!) times.
Diffstat (limited to 'synapse/events/snapshot.py')
-rw-r--r--synapse/events/snapshot.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/synapse/events/snapshot.py b/synapse/events/snapshot.py
index 0eab1aefd6..5833fee25f 100644
--- a/synapse/events/snapshot.py
+++ b/synapse/events/snapshot.py
@@ -163,7 +163,7 @@ class EventContext:
         return {
             "prev_state_id": prev_state_id,
             "event_type": event.type,
-            "event_state_key": event.state_key if event.is_state() else None,
+            "event_state_key": event.get_state_key(),
             "state_group": self._state_group,
             "state_group_before_event": self.state_group_before_event,
             "rejected": self.rejected,