Skip to content

Commit

Permalink
use default dict
Browse files Browse the repository at this point in the history
  • Loading branch information
deanlee committed Oct 13, 2024
1 parent fa8d301 commit 85a6b37
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion selfdrive/selfdrived/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import math
import os
from enum import IntEnum
from collections import defaultdict
from collections.abc import Callable

from cereal import log, car
Expand Down Expand Up @@ -51,7 +52,7 @@ class Events:
def __init__(self):
self.events: list[int] = []
self.static_events: list[int] = []
self.event_counters = dict.fromkeys(EVENTS.keys(), 0)
self.event_counters = defaultdict(int)
self.prev_event_set: set[int] = set()

@property
Expand Down

0 comments on commit 85a6b37

Please sign in to comment.