You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/08/17 09:53:12 UTC

[GitHub] [incubator-doris] imay commented on a change in pull request #4366: Optimise coding bit operation in BE

imay commented on a change in pull request #4366:
URL: https://github.com/apache/incubator-doris/pull/4366#discussion_r471368389



##########
File path: be/src/util/coding.h
##########
@@ -143,7 +143,7 @@ extern uint8_t* encode_varint64(uint8_t* dst, uint64_t value);
 inline uint8_t* encode_varint64(uint8_t* dst, uint64_t v) {
     static const unsigned int B = 128;
     while (v >= B) {
-        *(dst++) = (v & (B - 1)) | B;
+        *(dst++) = v | B;

Review comment:
       (v | B) & (11111111) != v | B
   
   If v = 1011111111
   (v | B) = 1011111111
   (v | B) &  (11111111) =  11111111
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org