perf:utils.tools.list_dict_find 功能优化
This commit is contained in:
parent
56fda7d2be
commit
072e759f67
@ -40,10 +40,7 @@ def list_dict_find(options: List[dict], key: str, value: any) -> Union[dict, Non
|
||||
"""
|
||||
字典列表查找
|
||||
"""
|
||||
for item in options:
|
||||
if item.get(key) == value:
|
||||
return item
|
||||
return None
|
||||
return next((item for item in options if item.get(key) == value), None)
|
||||
|
||||
|
||||
def get_time_interval(start_time: str, end_time: str, interval: int, time_format: str = "%H:%M:%S") -> List:
|
||||
|
Loading…
x
Reference in New Issue
Block a user