Removing unnecessary copies in AvrEvent construction
This commit is contained in:
@@ -28,22 +28,17 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr
|
|||||||
"contained invalid event data size.");
|
"contained invalid event data size.");
|
||||||
}
|
}
|
||||||
|
|
||||||
auto eventData = std::vector<unsigned char>();
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Ignore the SOF, protocol version, handler id and sequence ID (which all make up 5 bytes in total, 7 if we
|
* Ignore the SOF, protocol version, handler id and sequence ID (which all make up 5 bytes in total, 7 if we
|
||||||
* include the two size bytes)
|
* include the two size bytes)
|
||||||
*/
|
*/
|
||||||
eventData.insert(
|
this->eventData = std::vector<unsigned char>(
|
||||||
eventData.end(),
|
|
||||||
responseData.begin() + 7,
|
responseData.begin() + 7,
|
||||||
responseData.begin() + 7 + static_cast<std::int64_t>(responsePacketSize)
|
responseData.begin() + 7 + static_cast<std::int64_t>(responsePacketSize)
|
||||||
);
|
);
|
||||||
|
|
||||||
this->setEventData(eventData);
|
if (!this->eventData.empty()) {
|
||||||
|
this->eventId = this->eventData[0];
|
||||||
if (!eventData.empty()) {
|
|
||||||
this->eventId = eventData[0];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user