From 5dc4c89acc32eecfb5be37b7e9a8b15eb50fe010 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 30 May 2022 22:41:33 -1000 Subject: [PATCH] Small performance improvement for matching logbook rows (#72750) --- homeassistant/components/logbook/processor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/logbook/processor.py b/homeassistant/components/logbook/processor.py index ea6002cc62c..b3a43c2ca35 100644 --- a/homeassistant/components/logbook/processor.py +++ b/homeassistant/components/logbook/processor.py @@ -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