cyb70289 commented on a change in pull request #7285:
URL: https://github.com/apache/arrow/pull/7285#discussion_r433027819



##########
File path: cpp/src/arrow/util/bit_util.cc
##########
@@ -246,6 +246,49 @@ bool BitmapEquals(const uint8_t* left, int64_t 
left_offset, const uint8_t* right
   }
 
   // Unaligned slow case
+  left += left_offset / 8;
+  right += right_offset / 8;
+  left_offset %= 8;
+  right_offset %= 8;
+
+  // process in 64 bits
+  int64_t nwords = bit_length / 64;
+  if (nwords > 1) {
+    bit_length -= (nwords - 1) * 64;
+
+    uint64_t left_word0 = 
BitUtil::ToLittleEndian(util::SafeLoadAs<uint64_t>(left));
+    uint64_t right_word0 = 
BitUtil::ToLittleEndian(util::SafeLoadAs<uint64_t>(right));
+
+    do {

Review comment:
       Done. Much cleaner code after refinement. Thanks.

##########
File path: cpp/src/arrow/util/bit_util.cc
##########
@@ -246,6 +246,49 @@ bool BitmapEquals(const uint8_t* left, int64_t 
left_offset, const uint8_t* right
   }
 
   // Unaligned slow case
+  left += left_offset / 8;
+  right += right_offset / 8;
+  left_offset %= 8;
+  right_offset %= 8;
+
+  // process in 64 bits
+  int64_t nwords = bit_length / 64;
+  if (nwords > 1) {
+    bit_length -= (nwords - 1) * 64;
+
+    uint64_t left_word0 = 
BitUtil::ToLittleEndian(util::SafeLoadAs<uint64_t>(left));

Review comment:
       Done




----------------------------------------------------------------
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:
[email protected]


Reply via email to