diff --git a/selfdrive/controls/lib/events.py b/selfdrive/controls/lib/events.py index f68cd91814..85b3876f40 100644 --- a/selfdrive/controls/lib/events.py +++ b/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: