diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2020-02-21 07:15:07 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-21 07:15:07 -0500 |
commit | 509e381afa8c656e72f5fef3d651a9819794174a (patch) | |
tree | c86c50690fe104285cb2876c3cf953fb4c39e00b /synapse/state/v1.py | |
parent | Merge pull request #6967 from matrix-org/rav/increase_max_events_behind (diff) | |
download | synapse-509e381afa8c656e72f5fef3d651a9819794174a.tar.xz |
Clarify list/set/dict/tuple comprehensions and enforce via flake8 (#6957)
Ensure good comprehension hygiene using flake8-comprehensions.
Diffstat (limited to 'synapse/state/v1.py')
-rw-r--r-- | synapse/state/v1.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/synapse/state/v1.py b/synapse/state/v1.py index 24b7c0faef..9bf98d06f2 100644 --- a/synapse/state/v1.py +++ b/synapse/state/v1.py @@ -69,9 +69,9 @@ def resolve_events_with_store( unconflicted_state, conflicted_state = _seperate(state_sets) - needed_events = set( + needed_events = { event_id for event_ids in itervalues(conflicted_state) for event_id in event_ids - ) + } needed_event_count = len(needed_events) if event_map is not None: needed_events -= set(iterkeys(event_map)) @@ -261,11 +261,11 @@ def _resolve_state_events(conflicted_state, auth_events): def _resolve_auth_events(events, auth_events): - reverse = [i for i in reversed(_ordered_events(events))] + reverse = list(reversed(_ordered_events(events))) - auth_keys = set( + auth_keys = { key for event in events for key in event_auth.auth_types_for_event(event) - ) + } new_auth_events = {} for key in auth_keys: |