refactor: Cast type explicitly
This change: - Is a pure refactor without altering the assembly code, which might be verified, for example, with the https://godbolt.org/ service. - Fixes warning C4244 when compiling with MSVC at production quality W3 warning level.
This commit is contained in:
parent
068d5ee1a3
commit
524d270045
@ -56,7 +56,7 @@ char* EncodeVarint64(char* dst, uint64_t v) {
|
||||
static const int B = 128;
|
||||
uint8_t* ptr = reinterpret_cast<uint8_t*>(dst);
|
||||
while (v >= B) {
|
||||
*(ptr++) = v | B;
|
||||
*(ptr++) = static_cast<uint8_t>(v | B);
|
||||
v >>= 7;
|
||||
}
|
||||
*(ptr++) = static_cast<uint8_t>(v);
|
||||
|
Loading…
Reference in New Issue
Block a user