summary refs log tree commit diff
path: root/synapse/storage/persist_events.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2020-06-15 07:03:36 -0400
committerGitHub <noreply@github.com>2020-06-15 07:03:36 -0400
commitbd6dc17221741d4ceae05ae769a70696ae939336 (patch)
treea1313d5dbdc0785aba2066e859b58ad90edf10fa /synapse/storage/persist_events.py
parentFix warnings about losing log context during UI auth. (#7688) (diff)
downloadsynapse-bd6dc17221741d4ceae05ae769a70696ae939336.tar.xz
Replace iteritems/itervalues/iterkeys with native versions. (#7692)
Diffstat (limited to 'synapse/storage/persist_events.py')
-rw-r--r--synapse/storage/persist_events.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/synapse/storage/persist_events.py b/synapse/storage/persist_events.py
index f159400a87..92dfd709bc 100644
--- a/synapse/storage/persist_events.py
+++ b/synapse/storage/persist_events.py
@@ -20,7 +20,6 @@ import logging
 from collections import deque, namedtuple
 from typing import Iterable, List, Optional, Set, Tuple
 
-from six import iteritems
 from six.moves import range
 
 from prometheus_client import Counter, Histogram
@@ -218,7 +217,7 @@ class EventsPersistenceStorage(object):
             partitioned.setdefault(event.room_id, []).append((event, ctx))
 
         deferreds = []
-        for room_id, evs_ctxs in iteritems(partitioned):
+        for room_id, evs_ctxs in partitioned.items():
             d = self._event_persist_queue.add_to_queue(
                 room_id, evs_ctxs, backfilled=backfilled
             )
@@ -319,7 +318,7 @@ class EventsPersistenceStorage(object):
                             (event, context)
                         )
 
-                    for room_id, ev_ctx_rm in iteritems(events_by_room):
+                    for room_id, ev_ctx_rm in events_by_room.items():
                         latest_event_ids = await self.main_store.get_latest_event_ids_in_room(
                             room_id
                         )
@@ -674,7 +673,7 @@ class EventsPersistenceStorage(object):
 
         to_insert = {
             key: ev_id
-            for key, ev_id in iteritems(current_state)
+            for key, ev_id in current_state.items()
             if ev_id != existing_state.get(key)
         }