summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-10-29 14:01:49 +0000
committerErik Johnston <erik@matrix.org>2018-10-29 14:01:49 +0000
commitf4f223aa4455bea3aa642c23ae957932b1168ba3 (patch)
treeaf4124396b604f05cc549a82c29bc3a5f2ad859e /synapse/storage
parentMake SQL a bit cleaner (diff)
downloadsynapse-f4f223aa4455bea3aa642c23ae957932b1168ba3.tar.xz
Don't make temporary list
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/state.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/synapse/storage/state.py b/synapse/storage/state.py
index 45afd42b3f..947d3fc177 100644
--- a/synapse/storage/state.py
+++ b/synapse/storage/state.py
@@ -1266,9 +1266,8 @@ class StateGroupWorkerStore(EventsWorkerStore, SQLBaseStore):
                 current_search = next_to_search
                 next_to_search = set()
             else:
-                lst = list(next_to_search)
-                current_search = set(lst[:100])
-                next_to_search = set(lst[100:])
+                current_search = set(islice(next_to_search, 100))
+                next_to_search -= current_search
 
             # Check if state groups are referenced
             sql = """