mirror of
https://github.com/b4tman/sync_ics2gcal
synced 2025-01-21 07:28:24 +00:00
performance fix in get_item
This commit is contained in:
parent
ff4512fa00
commit
ebd88322d7
@ -40,8 +40,8 @@ class CalendarSync():
|
|||||||
keys_to_delete = set(keys_dst) - set(keys_src)
|
keys_to_delete = set(keys_dst) - set(keys_src)
|
||||||
|
|
||||||
def get_item(items, key_val):
|
def get_item(items, key_val):
|
||||||
items = list(filter(lambda item: item[key] == key_val, items))
|
for item in filter(lambda item: item[key] == key_val, items):
|
||||||
return items[0]
|
return item
|
||||||
|
|
||||||
def items_by_keys(items, key_name, keys):
|
def items_by_keys(items, key_name, keys):
|
||||||
return list(filter(lambda item: item[key_name] in keys, items))
|
return list(filter(lambda item: item[key_name] in keys, items))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user