Skip to content

Commit

Permalink
Small speed up to logbook humanify (#117854)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco committed May 21, 2024
1 parent e12d23b commit 0112c7f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions homeassistant/components/logbook/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,12 @@ def _humanify(
include_entity_name = logbook_run.include_entity_name
format_time = logbook_run.format_time
memoize_new_contexts = logbook_run.memoize_new_contexts
memoize_context = context_lookup.setdefault

# Process rows
for row in rows:
context_id_bin: bytes = row.context_id_bin
if memoize_new_contexts:
memoize_context(context_id_bin, row)
if memoize_new_contexts and context_id_bin not in context_lookup:
context_lookup[context_id_bin] = row
if row.context_only:
continue
event_type = row.event_type
Expand Down

0 comments on commit 0112c7f

Please sign in to comment.