Skip to content

Commit

Permalink
One line refactor to Packer.h
Browse files Browse the repository at this point in the history
The refactor changes how the floating point version of unpack()
advances the buffer pointer. The previous implementation did not
cause any known bugs (due to unstated assumptions about the
function's usage), but the newer version is more robust.
  • Loading branch information
syang0 committed Nov 21, 2020
1 parent b1b9ee0 commit c8d82dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion runtime/Packer.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ unpack(const char **in, uint8_t packNibble) {
T result;
int bytes = packNibble == 0 ? 16 : packNibble;
std::memcpy(&result, (*in), bytes);
(*in) += sizeof(T);
(*in) += bytes;

return result;
}
Expand Down

0 comments on commit c8d82dd

Please sign in to comment.