diff options
author | Erik Johnston <erik@matrix.org> | 2017-05-16 14:07:24 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2017-05-16 16:05:22 +0100 |
commit | 13f540ef1b94e6173bdd4f2d84d90e0948cf5bf2 (patch) | |
tree | 3d90773767c860162ce942065d034ac80928f62d /synapse/storage/roommember.py | |
parent | Merge pull request #2224 from matrix-org/erikj/prefill_state (diff) | |
download | synapse-13f540ef1b94e6173bdd4f2d84d90e0948cf5bf2.tar.xz |
Speed up get_joined_hosts
Diffstat (limited to 'synapse/storage/roommember.py')
-rw-r--r-- | synapse/storage/roommember.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/storage/roommember.py b/synapse/storage/roommember.py index 2fa20bd87c..404f3583eb 100644 --- a/synapse/storage/roommember.py +++ b/synapse/storage/roommember.py @@ -534,7 +534,7 @@ class RoomMemberStore(SQLBaseStore): assert state_group is not None joined_hosts = set() - for (etype, state_key), event_id in current_state_ids.items(): + for etype, state_key in current_state_ids: if etype == EventTypes.Member: try: host = get_domain_from_id(state_key) @@ -545,6 +545,7 @@ class RoomMemberStore(SQLBaseStore): if host in joined_hosts: continue + event_id = current_state_ids[(etype, state_key)] event = yield self.get_event(event_id, allow_none=True) if event and event.content["membership"] == Membership.JOIN: joined_hosts.add(intern_string(host)) |