diff options
author | Erik Johnston <erik@matrix.org> | 2017-04-10 16:55:56 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2017-04-10 16:55:56 +0100 |
commit | 84fbb80c8f6cef2e37195e3fd321c3ddab760c1f (patch) | |
tree | 60961780800eb5c366cb58b5b1ac2016109a358f /synapse | |
parent | Dedupe KeyedEdu and Devices federation repl traffic (diff) | |
download | synapse-84fbb80c8f6cef2e37195e3fd321c3ddab760c1f.tar.xz |
Use generators
Diffstat (limited to 'synapse')
-rw-r--r-- | synapse/federation/send_queue.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/federation/send_queue.py b/synapse/federation/send_queue.py index 7d79c069f1..fcd9929990 100644 --- a/synapse/federation/send_queue.py +++ b/synapse/federation/send_queue.py @@ -282,7 +282,7 @@ class FederationRemoteSendQueue(object): keys = self.edus.keys() i = keys.bisect_right(from_token) j = keys.bisect_right(to_token) + 1 - edus = [(k, self.edus[k]) for k in keys[i:j]] + edus = ((k, self.edus[k]) for k in keys[i:j]) for (pos, edu) in edus: rows.append((pos, EduRow(edu))) @@ -291,7 +291,7 @@ class FederationRemoteSendQueue(object): keys = self.failures.keys() i = keys.bisect_right(from_token) j = keys.bisect_right(to_token) + 1 - failures = [(k, self.failures[k]) for k in keys[i:j]] + failures = ((k, self.failures[k]) for k in keys[i:j]) for (pos, (destination, failure)) in failures: rows.append((pos, FailureRow( |