diff options
author | Erik Johnston <erik@matrix.org> | 2018-08-09 14:44:10 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2018-08-09 14:58:49 +0100 |
commit | bb99b1f5507e009bc32a82ba6ef29ba2d91e6b65 (patch) | |
tree | 41197ba70414b621b96b025d839849b78ff489fb /synapse/state | |
parent | Choose state algorithm based on room version (diff) | |
download | synapse-bb99b1f5507e009bc32a82ba6ef29ba2d91e6b65.tar.xz |
Add fast path in state res for zero prev events
Diffstat (limited to 'synapse/state')
-rw-r--r-- | synapse/state/__init__.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/synapse/state/__init__.py b/synapse/state/__init__.py index 222daa0b28..f1c26d1071 100644 --- a/synapse/state/__init__.py +++ b/synapse/state/__init__.py @@ -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) |