PragmaTwice commented on code in PR #2340:
URL: https://github.com/apache/kvrocks/pull/2340#discussion_r1622195339


##########
src/common/bit_util.h:
##########
@@ -41,6 +41,13 @@ inline size_t RawPopcount(const uint8_t *p, int64_t count) {
 
   return bits;
 }
+inline bool Int64OperationOverFlow(int64_t a, int64_t b, int64_t result, 
uint8_t operation) {
+  if (operation == 1) {
+    return __builtin_add_overflow(a, b, &result);
+  } else {
+    return __builtin_mul_overflow(a, b, &result);
+  }
+}

Review Comment:
   This function looks very weird. What's `operation`? What's `1` here? Why 
`mul` is executed if `operation` is not 1?
   
   Please remove it.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to