events: cleanup function any (#23479)

This commit is contained in:
Dean Lee
2022-01-10 21:32:07 +08:00
committed by GitHub
parent 842ba8e5e6
commit 8eec818ae6
+1 -4
View File
@@ -63,10 +63,7 @@ class Events:
self.events = self.static_events.copy()
def any(self, event_type: str) -> bool:
for e in self.events:
if event_type in EVENTS.get(e, {}).keys():
return True
return False
return any(event_type in EVENTS.get(e, {}) for e in self.events)
def create_alerts(self, event_types: List[str], callback_args=None):
if callback_args is None: