mirror of
https://github.com/zulip/zulip.git
synced 2025-11-20 06:28:23 +00:00
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:
@@ -100,10 +100,10 @@ def check_send_webhook_message(
|
|||||||
# shell-style wildcards.
|
# shell-style wildcards.
|
||||||
if (
|
if (
|
||||||
only_events is not None
|
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 (
|
) or (
|
||||||
exclude_events is not None
|
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
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user