use set for speedup

This commit is contained in:
Pascal Vizeli 2017-07-24 10:36:47 +02:00 committed by GitHub
parent e78d935824
commit 4915c935dd

View File

@ -54,8 +54,8 @@ class APIAddons(object):
"""Return a simplified device list.""" """Return a simplified device list."""
dev_list = addon.devices dev_list = addon.devices
if not dev_list: if not dev_list:
return [] return
return [row.split(':')[0] for row in dev_list] return set(row.split(':')[0] for row in dev_list)
@api_process @api_process
async def list(self, request): async def list(self, request):