Small performance improvement for matching logbook rows (#72750)

pull/72824/head
J. Nick Koston 2022-05-30 22:41:33 -10:00 committed by Paulus Schoutsen
parent 7c2f73ddba
commit ca8c750a5a
1 changed files with 2 additions and 1 deletions

View File

@ -407,7 +407,8 @@ class ContextAugmenter:
def _rows_match(row: Row | EventAsRow, other_row: Row | EventAsRow) -> bool:
"""Check of rows match by using the same method as Events __hash__."""
if (
(state_id := row.state_id) is not None
row is other_row
or (state_id := row.state_id) is not None
and state_id == other_row.state_id
or (event_id := row.event_id) is not None
and event_id == other_row.event_id