Fix (final) Bugbear violations (#9838)

This commit is contained in:
Jonathan de Jong 2021-04-20 12:50:49 +02:00 committed by GitHub
parent 71f0623de9
commit 495b214f4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 46 additions and 49 deletions

View file

@ -170,7 +170,7 @@ class PersistEventsStore:
)
async with stream_ordering_manager as stream_orderings:
for (event, context), stream in zip(events_and_contexts, stream_orderings):
for (event, _), stream in zip(events_and_contexts, stream_orderings):
event.internal_metadata.stream_ordering = stream
await self.db_pool.runInteraction(
@ -297,7 +297,7 @@ class PersistEventsStore:
txn.execute(sql + clause, args)
to_recursively_check = []
for event_id, prev_event_id, metadata, rejected in txn:
for _, prev_event_id, metadata, rejected in txn:
if prev_event_id in existing_prevs:
continue
@ -1127,7 +1127,7 @@ class PersistEventsStore:
def _update_forward_extremities_txn(
self, txn, new_forward_extremities, max_stream_order
):
for room_id, new_extrem in new_forward_extremities.items():
for room_id in new_forward_extremities.keys():
self.db_pool.simple_delete_txn(
txn, table="event_forward_extremities", keyvalues={"room_id": room_id}
)
@ -1399,7 +1399,7 @@ class PersistEventsStore:
]
state_values = []
for event, context in state_events_and_contexts:
for event, _ in state_events_and_contexts:
vals = {
"event_id": event.event_id,
"room_id": event.room_id,
@ -1468,7 +1468,7 @@ class PersistEventsStore:
# nothing to do here
return
for event, context in events_and_contexts:
for event, _ in events_and_contexts:
if event.type == EventTypes.Redaction and event.redacts is not None:
# Remove the entries in the event_push_actions table for the
# redacted event.