Skip to content

Commit

Permalink
Apply some optimization to section 3
Browse files Browse the repository at this point in the history
  • Loading branch information
realtyem committed Nov 7, 2023
1 parent 92d6aff commit 0ca1dfd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions synapse/storage/databases/main/event_federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,16 +420,16 @@ def _get_auth_chain_ids_using_cover_index_txn(
# chains are only reachable if the origin sequence number of
# the link is less than the max sequence number in the
# origin chain.
if origin_sequence_number <= event_chains.get(origin_chain_id, 0):
if origin_sequence_number <= event_chains_get(origin_chain_id, 0):
chains[target_chain_id] = max(
target_sequence_number,
chains.get(target_chain_id, 0),
chains_get(target_chain_id, 0),
)

# Add the initial set of chains, excluding the sequence corresponding to
# initial event.
for chain_id, seq_no in event_chains.items():
max_sequence_result = max(seq_no - 1, chains.get(chain_id, 0))
max_sequence_result = max(seq_no - 1, chains_get(chain_id, 0))
if max_sequence_result > 0:
chains[chain_id] = max_sequence_result

Expand Down

0 comments on commit 0ca1dfd

Please sign in to comment.