From af2798f0632d521edee7ba455e41fa75cb6c3c51 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 21 Sep 2024 20:18:53 -0400 Subject: [PATCH] Switch genexp to listcomp in async_progress_by_init_data_type (#126405) Since listcomps are inlined in python 3.12+, the listcomp will be a bit faster. Additionally we always iterate everything here so there is no reason to use a genexpr --- homeassistant/data_entry_flow.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/data_entry_flow.py b/homeassistant/data_entry_flow.py index 7ecbe5508c6..dff7ebee03c 100644 --- a/homeassistant/data_entry_flow.py +++ b/homeassistant/data_entry_flow.py @@ -296,11 +296,11 @@ class FlowManager(abc.ABC, Generic[_FlowResultT, _HandlerT]): ) -> list[_FlowResultT]: """Return flows in progress init matching by data type as a partial FlowResult.""" return self._async_flow_handler_to_flow_result( - ( + [ progress for progress in self._init_data_process_index.get(init_data_type, ()) if matcher(progress.init_data) - ), + ], include_uninitialized, )