From d76b938a03921a8b611d71e5d74226cd6b1fee45 Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Thu, 29 Apr 2021 04:50:21 +0800 Subject: [PATCH] reserve space for vector of can_frame (#20771) old-commit-hash: e151425c1c7f3e642b06504c165d7db8bab8a603 --- selfdrive/boardd/boardd_api_impl.pyx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/selfdrive/boardd/boardd_api_impl.pyx b/selfdrive/boardd/boardd_api_impl.pyx index 3f50fbaab6..0d428a9259 100644 --- a/selfdrive/boardd/boardd_api_impl.pyx +++ b/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]