Skip to content

Commit

Permalink
events: cleanup function any (#23479)
Browse files Browse the repository at this point in the history
  • Loading branch information
deanlee authored Jan 10, 2022
1 parent 842ba8e commit 8eec818
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions selfdrive/controls/lib/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,7 @@ def clear(self) -> None:
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:
Expand Down

0 comments on commit 8eec818

Please sign in to comment.