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
This commit is contained in:
J. Nick Koston 2024-09-21 20:18:53 -04:00 committed by GitHub
parent d8e9d1c16e
commit af2798f063
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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,
)