1
0
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:
nierob
2019-07-19 20:36:18 +00:00
committed by Paulus Schoutsen
parent caa7a3a3d6
commit 979f801488
13 changed files with 42 additions and 42 deletions

View File

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