boardd: const reference pandaStates to avoid copy (#23030)

old-commit-hash: ab9c7a11a9
commatwo_master
Dean Lee 3 years ago committed by GitHub
parent d537897e9a
commit 04fefd6791
  1. 2
      selfdrive/boardd/boardd.cc

@ -307,7 +307,7 @@ bool send_panda_states(PubMaster *pm, const std::vector<Panda *> &pandas, bool s
for (uint32_t i=0; i<pandas.size(); i++) { for (uint32_t i=0; i<pandas.size(); i++) {
auto panda = pandas[i]; auto panda = pandas[i];
auto pandaState = pandaStates[i]; const auto &pandaState = pandaStates[i];
// Make sure CAN buses are live: safety_setter_thread does not work if Panda CAN are silent and there is only one other CAN node // Make sure CAN buses are live: safety_setter_thread does not work if Panda CAN are silent and there is only one other CAN node
if (pandaState.safety_model == (uint8_t)(cereal::CarParams::SafetyModel::SILENT)) { if (pandaState.safety_model == (uint8_t)(cereal::CarParams::SafetyModel::SILENT)) {

Loading…
Cancel
Save