mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 20:04:51 -04:00
Clarify list/set/dict/tuple comprehensions and enforce via flake8 (#6957)
Ensure good comprehension hygiene using flake8-comprehensions.
This commit is contained in:
parent
272eee1ae1
commit
509e381afa
73 changed files with 251 additions and 276 deletions
|
@ -75,7 +75,7 @@ def filter_events_for_client(
|
|||
"""
|
||||
# Filter out events that have been soft failed so that we don't relay them
|
||||
# to clients.
|
||||
events = list(e for e in events if not e.internal_metadata.is_soft_failed())
|
||||
events = [e for e in events if not e.internal_metadata.is_soft_failed()]
|
||||
|
||||
types = ((EventTypes.RoomHistoryVisibility, ""), (EventTypes.Member, user_id))
|
||||
event_id_to_state = yield storage.state.get_state_for_events(
|
||||
|
@ -97,7 +97,7 @@ def filter_events_for_client(
|
|||
erased_senders = yield storage.main.are_users_erased((e.sender for e in events))
|
||||
|
||||
if apply_retention_policies:
|
||||
room_ids = set(e.room_id for e in events)
|
||||
room_ids = {e.room_id for e in events}
|
||||
retention_policies = {}
|
||||
|
||||
for room_id in room_ids:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue