mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 10:17:09 +00:00
Small performance improvement for matching logbook rows (#72750)
This commit is contained in:
parent
ca5f13b576
commit
5dc4c89acc
@ -407,7 +407,8 @@ class ContextAugmenter:
|
|||||||
def _rows_match(row: Row | EventAsRow, other_row: Row | EventAsRow) -> bool:
|
def _rows_match(row: Row | EventAsRow, other_row: Row | EventAsRow) -> bool:
|
||||||
"""Check of rows match by using the same method as Events __hash__."""
|
"""Check of rows match by using the same method as Events __hash__."""
|
||||||
if (
|
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
|
and state_id == other_row.state_id
|
||||||
or (event_id := row.event_id) is not None
|
or (event_id := row.event_id) is not None
|
||||||
and event_id == other_row.event_id
|
and event_id == other_row.event_id
|
||||||
|
Loading…
x
Reference in New Issue
Block a user