mirror of
https://github.com/home-assistant/core.git
synced 2025-12-25 05:26:47 +00:00
Avoid creating temporary lists (#25317)
That gives nano performance improvements as *() is slightly faster then *[].
This commit is contained in:
@@ -57,10 +57,10 @@ async def async_get_device_automation_triggers(hass, device_id):
|
||||
for entity in entities:
|
||||
domains.add(split_entity_id(entity.entity_id)[0])
|
||||
|
||||
device_triggers = await asyncio.gather(*[
|
||||
device_triggers = await asyncio.gather(*(
|
||||
_async_get_device_automation_triggers(hass, domain, device_id)
|
||||
for domain in domains
|
||||
])
|
||||
))
|
||||
for device_trigger in device_triggers:
|
||||
if device_trigger is not None:
|
||||
triggers.extend(device_trigger)
|
||||
|
||||
Reference in New Issue
Block a user