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:
Hennadii Stepanov 2023-11-05 12:07:25 +00:00
parent 068d5ee1a3
commit 524d270045
No known key found for this signature in database
GPG Key ID: 410108112E7EA81F

View File

@ -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);