mirror of https://github.com/zulip/zulip.git
python: Remove unnecessary list comprehension.
`all` can take a generator, not just a list. Using a generator expression here is simpler and faster.
This commit is contained in:
parent
b673e966ca
commit
ad61d06cea
|
@ -100,10 +100,10 @@ def check_send_webhook_message(
|
|||
# shell-style wildcards.
|
||||
if (
|
||||
only_events is not None
|
||||
and all([not fnmatch.fnmatch(complete_event_type, pattern) for pattern in only_events])
|
||||
and all(not fnmatch.fnmatch(complete_event_type, pattern) for pattern in only_events)
|
||||
) or (
|
||||
exclude_events is not None
|
||||
and any([fnmatch.fnmatch(complete_event_type, pattern) for pattern in exclude_events])
|
||||
and any(fnmatch.fnmatch(complete_event_type, pattern) for pattern in exclude_events)
|
||||
):
|
||||
return
|
||||
|
||||
|
|
Loading…
Reference in New Issue