mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 08:14:00 +08:00
reserve space for vector of can_frame (#20771)
old-commit-hash: e151425c1c7f3e642b06504c165d7db8bab8a603
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user