Remove redundant conditions

This commit is contained in:
Erik Johnston 2018-05-30 11:33:57 +01:00
parent 1810cc3f7e
commit 1cdd0d3b0d
1 changed files with 9 additions and 10 deletions

View File

@ -1459,6 +1459,7 @@ class EventsStore(EventsWorkerStore):
retcol="COALESCE(MAX(topological_ordering), 0)", retcol="COALESCE(MAX(topological_ordering), 0)",
) )
new_topo += 1 new_topo += 1
# If there is only one forward chunk and only one sibling event (which # If there is only one forward chunk and only one sibling event (which
# would be the given event), then this satisfies condition two. # would be the given event), then this satisfies condition two.
elif len(forward_chunk_ids) == 1 and len(sibling_events) == 1: elif len(forward_chunk_ids) == 1 and len(sibling_events) == 1:
@ -1511,17 +1512,15 @@ class EventsStore(EventsWorkerStore):
if fid not in current_forward_ids and fid != chunk_id if fid not in current_forward_ids and fid != chunk_id
) )
if prev_chunk_ids: for pid in prev_chunk_ids:
for pid in prev_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. table.add_edge(pid, chunk_id)
table.add_edge(pid, chunk_id)
if forward_chunk_ids: 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. 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.