From cf1b5f473259e46c667f3fb5a28bcd884ee3a102 Mon Sep 17 00:00:00 2001 From: Cheng Chang Date: Fri, 22 Mar 2019 17:32:20 +0800 Subject: [PATCH] Remove unnecessary bit operation. --- util/coding.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/coding.cc b/util/coding.cc index 9e72613440..1a9e3337bd 100644 --- a/util/coding.cc +++ b/util/coding.cc @@ -82,7 +82,7 @@ char* EncodeVarint64(char* dst, uint64_t v) { static const int B = 128; unsigned char* ptr = reinterpret_cast(dst); while (v >= B) { - *(ptr++) = (v & (B-1)) | B; + *(ptr++) = v | B; v >>= 7; } *(ptr++) = static_cast(v);