Merge pull request #2228 from matrix-org/erikj/speed_up_get_hosts

Speed up get_joined_hosts
This commit is contained in:
Erik Johnston 2017-05-16 17:40:55 +01:00 committed by GitHub
commit 6fa8148ccb
2 changed files with 4 additions and 2 deletions

View file

@ -739,10 +739,11 @@ class RoomMemberHandler(BaseHandler):
if len(current_state_ids) == 1 and create_event_id:
defer.returnValue(self.hs.is_mine_id(create_event_id))
for (etype, state_key), event_id in current_state_ids.items():
for etype, state_key in current_state_ids:
if etype != EventTypes.Member or not self.hs.is_mine_id(state_key):
continue
event_id = current_state_ids[(etype, state_key)]
event = yield self.store.get_event(event_id, allow_none=True)
if not event:
continue