Replace filter usage
This commit is contained in:
parent
4238ee090d
commit
dadf8adb3e
@ -217,7 +217,8 @@ class Telegram(RPC):
|
||||
|
||||
"*Open Order:* `{open_order}`" if r['open_order'] else ""
|
||||
]
|
||||
messages.append("\n".join(filter(None, lines)).format(**r))
|
||||
# Filter empty lines using list-comprehension
|
||||
messages.append("\n".join([l for l in lines if l]).format(**r))
|
||||
|
||||
for msg in messages:
|
||||
self._send_msg(msg, bot=bot)
|
||||
|
@ -23,7 +23,7 @@ def fig_generating_mock(fig, *args, **kwargs):
|
||||
|
||||
|
||||
def find_trace_in_fig_data(data, search_string: str):
|
||||
matches = filter(lambda x: x.name == search_string, data)
|
||||
matches = (d for d in data if d.name == search_string)
|
||||
return next(matches)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user