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

more six iteritems #3279

Merged
merged 1 commit into from
May 24, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions synapse/storage/roommember.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import logging
import simplejson as json

from six import itervalues, iteritems

logger = logging.getLogger(__name__)


Expand Down Expand Up @@ -272,7 +274,7 @@ def _get_joined_users_from_context(self, room_id, state_group, current_state_ids
users_in_room = {}
member_event_ids = [
e_id
for key, e_id in current_state_ids.iteritems()
for key, e_id in iteritems(current_state_ids)
if key[0] == EventTypes.Member
]

Expand All @@ -289,7 +291,7 @@ def _get_joined_users_from_context(self, room_id, state_group, current_state_ids
users_in_room = dict(prev_res)
member_event_ids = [
e_id
for key, e_id in context.delta_ids.iteritems()
for key, e_id in iteritems(context.delta_ids)
if key[0] == EventTypes.Member
]
for etype, state_key in context.delta_ids:
Expand Down Expand Up @@ -741,7 +743,7 @@ def get_destinations(self, state_entry):
if state_entry.state_group == self.state_group:
pass
elif state_entry.prev_group == self.state_group:
for (typ, state_key), event_id in state_entry.delta_ids.iteritems():
for (typ, state_key), event_id in iteritems(state_entry.delta_ids):
if typ != EventTypes.Member:
continue

Expand Down Expand Up @@ -771,7 +773,7 @@ def get_destinations(self, state_entry):
self.state_group = state_entry.state_group
else:
self.state_group = object()
self._len = sum(len(v) for v in self.hosts_to_joined_users.itervalues())
self._len = sum(len(v) for v in itervalues(self.hosts_to_joined_users))
defer.returnValue(frozenset(self.hosts_to_joined_users))

def __len__(self):
Expand Down