mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-12-11 22:24:18 -05:00
Use generators
This commit is contained in:
parent
40453b3f84
commit
84fbb80c8f
@ -282,7 +282,7 @@ class FederationRemoteSendQueue(object):
|
|||||||
keys = self.edus.keys()
|
keys = self.edus.keys()
|
||||||
i = keys.bisect_right(from_token)
|
i = keys.bisect_right(from_token)
|
||||||
j = keys.bisect_right(to_token) + 1
|
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:
|
for (pos, edu) in edus:
|
||||||
rows.append((pos, EduRow(edu)))
|
rows.append((pos, EduRow(edu)))
|
||||||
@ -291,7 +291,7 @@ class FederationRemoteSendQueue(object):
|
|||||||
keys = self.failures.keys()
|
keys = self.failures.keys()
|
||||||
i = keys.bisect_right(from_token)
|
i = keys.bisect_right(from_token)
|
||||||
j = keys.bisect_right(to_token) + 1
|
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:
|
for (pos, (destination, failure)) in failures:
|
||||||
rows.append((pos, FailureRow(
|
rows.append((pos, FailureRow(
|
||||||
|
Loading…
Reference in New Issue
Block a user