Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Move variable definition closer to usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Fizzadar committed Nov 28, 2022
1 parent de2d9ba commit 72c7be1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions synapse/storage/databases/main/event_push_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,6 @@ def _get_unread_counts_by_room_for_user_txn(
)
args.extend([user_id, user_id])

room_to_count: Dict[str, int] = defaultdict(int)

receipts_cte = f"""
WITH all_receipts AS (
SELECT room_id, thread_id, MAX(event_stream_ordering) AS max_receipt_stream_ordering
Expand Down Expand Up @@ -557,6 +555,7 @@ def _get_unread_counts_by_room_for_user_txn(
txn.execute(sql, args)

seen_thread_ids = set()
room_to_count: Dict[str, int] = defaultdict(int)

for room_id, thread_id, notif_count in txn:
room_to_count[room_id] += notif_count
Expand Down

0 comments on commit 72c7be1

Please sign in to comment.