diff options
author | Erik Johnston <erik@matrix.org> | 2018-05-30 11:33:57 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2018-05-30 11:33:57 +0100 |
commit | 1cdd0d3b0dad5076df073bbb6a48a55c02560e6e (patch) | |
tree | 8b6d3c5169b652c81e84b792d51d61527a5fd6c2 | |
parent | Remove unnecessary set (diff) | |
download | synapse-1cdd0d3b0dad5076df073bbb6a48a55c02560e6e.tar.xz |
Remove redundant conditions
-rw-r--r-- | synapse/storage/events.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/synapse/storage/events.py b/synapse/storage/events.py index 0c870df3f7..2f648111b3 100644 --- a/synapse/storage/events.py +++ b/synapse/storage/events.py @@ -1459,6 +1459,7 @@ class EventsStore(EventsWorkerStore): retcol="COALESCE(MAX(topological_ordering), 0)", ) new_topo += 1 + # If there is only one forward chunk and only one sibling event (which # would be the given event), then this satisfies condition two. 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 prev_chunk_ids: - for pid in prev_chunk_ids: - # Note that the edge direction is reversed than what you might - # expect. See ChunkDBOrderedListStore for more details. - table.add_edge(pid, chunk_id) + for pid in prev_chunk_ids: + # Note that the edge direction is reversed than what you might + # expect. See ChunkDBOrderedListStore for more details. + table.add_edge(pid, chunk_id) - if forward_chunk_ids: - for fid in forward_chunk_ids: - # Note that the edge direction is reversed than what you might - # expect. See ChunkDBOrderedListStore for more details. - table.add_edge(chunk_id, fid) + for fid in forward_chunk_ids: + # Note that the edge direction is reversed than what you might + # expect. See ChunkDBOrderedListStore for more details. + table.add_edge(chunk_id, fid) # We now need to update the backwards extremities for the chunks. |