Add fast path in state res for zero prev events

pull/3673/head
Erik Johnston 2018-08-09 14:44:10 +01:00
parent ce6db0e547
commit bb99b1f550
1 changed files with 6 additions and 1 deletions

View File

@ -361,7 +361,12 @@ class StateHandler(object):
room_id, event_ids
)
if len(state_groups_ids) == 1:
if len(state_groups_ids) == 0:
defer.returnValue(_StateCacheEntry(
state={},
state_group=None,
))
elif len(state_groups_ids) == 1:
name, state_list = list(state_groups_ids.items()).pop()
prev_group, delta_ids = yield self.store.get_state_group_delta(name)