events: cleanup function any (#23479)

old-commit-hash: 8eec818ae6
commatwo_master
Dean Lee 4 years ago committed by GitHub
parent 08212107e8
commit 75d00872e8
  1. 5
      selfdrive/controls/lib/events.py

@ -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:

Loading…
Cancel
Save