Skip to content

Commit

Permalink
remove unnecessary comprehensions (#863)
Browse files Browse the repository at this point in the history
  • Loading branch information
dek3rr authored and rbiasini committed Oct 28, 2019
1 parent d2a92fc commit 2a77b02
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion selfdrive/can/can_define.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ def __init__(self, dbc_name):
self.dv[msgname] = {}

# two ways to lookup: address or msg name
self.dv[address][sgname] = {v: d for v, d in zip(values, defs)} #build dict
self.dv[address][sgname] = dict(zip(values, defs))
self.dv[msgname][sgname] = self.dv[address][sgname]
2 changes: 1 addition & 1 deletion selfdrive/can/plant_can_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self, dbc_f, signals, checks=None):
# - frequency is the frequency at which health should be monitored.

checks = [] if checks is None else checks
self.msgs_ck = set([check[0] for check in checks])
self.msgs_ck = {check[0] for check in checks}
self.frqs = dict(checks)
self.can_valid = False # start with False CAN assumption
# list of received msg we want to monitor counter and checksum for
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/can/process_dbc.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def main():
for address, ((msg_name, msg_size), msg_sigs) in sorted(can_dbc.msgs.items()) if msg_sigs]

def_vals = {a: set(b) for a,b in can_dbc.def_vals.items()} #remove duplicates
def_vals = [(address, sig) for address, sig in sorted(def_vals.items())]
def_vals = sorted(def_vals.items())

if can_dbc.name.startswith(("honda_", "acura_")):
checksum_type = "honda"
Expand Down

0 comments on commit 2a77b02

Please sign in to comment.