VersionPacket: Use C++11 function signature

pull/35/head
Paul Hollinsky 2021-06-11 18:40:50 -04:00
parent 4588cb55fa
commit c888aad5ae
1 changed files with 4 additions and 2 deletions

View File

@ -8,7 +8,8 @@ std::shared_ptr<VersionMessage> HardwareVersionPacket::DecodeMainToMessage(const
auto msg = std::make_shared<VersionMessage>(true); auto msg = std::make_shared<VersionMessage>(true);
optional<DeviceAppVersion>& version = msg->Versions.emplace_back(); msg->Versions.emplace_back();
optional<DeviceAppVersion>& version = msg->Versions.back();
version.emplace(); version.emplace();
version->major = bytestream[1]; version->major = bytestream[1];
version->minor = bytestream[2]; version->minor = bytestream[2];
@ -24,7 +25,8 @@ std::shared_ptr<VersionMessage> HardwareVersionPacket::DecodeSecondaryToMessage(
bytesLeft--; // Disregard command byte bytesLeft--; // Disregard command byte
while(bytesLeft >= 3) { while(bytesLeft >= 3) {
const bool versionValid = bytestream[bytestream.size() - bytesLeft + 0]; const bool versionValid = bytestream[bytestream.size() - bytesLeft + 0];
optional<DeviceAppVersion>& version = msg->Versions.emplace_back(); msg->Versions.emplace_back();
optional<DeviceAppVersion>& version = msg->Versions.back();
if(versionValid) { if(versionValid) {
version.emplace(); version.emplace();
version->major = bytestream[bytestream.size() - bytesLeft + 1]; version->major = bytestream[bytestream.size() - bytesLeft + 1];