Skip to content

Commit f71fd7b

Browse files
authored
get value by reference in ranged based loop (commaai#624)
1 parent e035fa1 commit f71fd7b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/windows/pandaJ2534DLL/PandaJ2534Device.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ DWORD PandaJ2534Device::kline_recv_thread() {
150150
continue;
151151
}
152152

153-
for (auto msg : msg_recv) {
153+
for (auto &msg : msg_recv) {
154154
for (auto& conn : this->connections) {
155155
if (conn != nullptr && !conn->isProtoCan()) {
156156
J2534Frame msg_out(conn->getProtocol(), msg);

drivers/windows/panda_shared/panda.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ bool Panda::can_send_many(const std::vector<PANDA_CAN_MSG>& can_msgs) {
323323
std::vector<PANDA_CAN_MSG_INTERNAL> formatted_msgs;
324324
formatted_msgs.reserve(can_msgs.size());
325325

326-
for (auto msg : can_msgs) {
326+
for (auto &msg : can_msgs) {
327327
if (msg.bus == PANDA_CAN_UNK) continue;
328328
if (msg.len > 8) continue;
329329
PANDA_CAN_MSG_INTERNAL tmpmsg = {};

0 commit comments

Comments
 (0)