mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-07-29 02:28:37 -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
|
@ -145,7 +145,7 @@ class EventsStore(
|
|||
return txn.fetchall()
|
||||
|
||||
res = yield self.db.runInteraction("read_forward_extremities", fetch)
|
||||
self._current_forward_extremities_amount = c_counter(list(x[0] for x in res))
|
||||
self._current_forward_extremities_amount = c_counter([x[0] for x in res])
|
||||
|
||||
@_retry_on_integrity_error
|
||||
@defer.inlineCallbacks
|
||||
|
@ -598,11 +598,11 @@ class EventsStore(
|
|||
# We find out which membership events we may have deleted
|
||||
# and which we have added, then we invlidate the caches for all
|
||||
# those users.
|
||||
members_changed = set(
|
||||
members_changed = {
|
||||
state_key
|
||||
for ev_type, state_key in itertools.chain(to_delete, to_insert)
|
||||
if ev_type == EventTypes.Member
|
||||
)
|
||||
}
|
||||
|
||||
for member in members_changed:
|
||||
txn.call_after(
|
||||
|
@ -1615,7 +1615,7 @@ class EventsStore(
|
|||
"""
|
||||
)
|
||||
|
||||
referenced_state_groups = set(sg for sg, in txn)
|
||||
referenced_state_groups = {sg for sg, in txn}
|
||||
logger.info(
|
||||
"[purge] found %i referenced state groups", len(referenced_state_groups)
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue