reserve space for vector of can_frame (#20771)

old-commit-hash: e151425c1c
commatwo_master
Dean Lee 4 years ago committed by GitHub
parent 9aa9d33f92
commit d76b938a03
  1. 2
      selfdrive/boardd/boardd_api_impl.pyx

@ -14,6 +14,8 @@ cdef extern void can_list_to_can_capnp_cpp(const vector[can_frame] &can_list, st
def can_list_to_can_capnp(can_msgs, msgtype='can', valid=True):
cdef vector[can_frame] can_list
can_list.reserve(len(can_msgs))
cdef can_frame f
for can_msg in can_msgs:
f.address = can_msg[0]

Loading…
Cancel
Save