Just iterate once rather than create a new set
This commit is contained in:
parent
1cdd0d3b0d
commit
ecd4931ab2
|
@ -1503,16 +1503,8 @@ class EventsStore(EventsWorkerStore):
|
||||||
retcol="chunk_id",
|
retcol="chunk_id",
|
||||||
)
|
)
|
||||||
|
|
||||||
prev_chunk_ids = set(
|
|
||||||
pid for pid in prev_chunk_ids
|
|
||||||
if pid is not None and pid not in current_prev_ids and pid != chunk_id
|
|
||||||
)
|
|
||||||
forward_chunk_ids = set(
|
|
||||||
fid for fid in forward_chunk_ids
|
|
||||||
if fid not in current_forward_ids and fid != chunk_id
|
|
||||||
)
|
|
||||||
|
|
||||||
for pid in prev_chunk_ids:
|
for pid in prev_chunk_ids:
|
||||||
|
if pid is not None and pid not in current_prev_ids and pid != chunk_id:
|
||||||
# Note that the edge direction is reversed than what you might
|
# Note that the edge direction is reversed than what you might
|
||||||
# expect. See ChunkDBOrderedListStore for more details.
|
# expect. See ChunkDBOrderedListStore for more details.
|
||||||
table.add_edge(pid, chunk_id)
|
table.add_edge(pid, chunk_id)
|
||||||
|
@ -1520,6 +1512,7 @@ class EventsStore(EventsWorkerStore):
|
||||||
for fid in forward_chunk_ids:
|
for fid in forward_chunk_ids:
|
||||||
# Note that the edge direction is reversed than what you might
|
# Note that the edge direction is reversed than what you might
|
||||||
# expect. See ChunkDBOrderedListStore for more details.
|
# expect. See ChunkDBOrderedListStore for more details.
|
||||||
|
if fid not in current_forward_ids and fid != chunk_id:
|
||||||
table.add_edge(chunk_id, fid)
|
table.add_edge(chunk_id, fid)
|
||||||
|
|
||||||
# We now need to update the backwards extremities for the chunks.
|
# We now need to update the backwards extremities for the chunks.
|
||||||
|
|
Loading…
Reference in New Issue