ariel-miculas commented on code in PR #11872:
URL: https://github.com/apache/arrow-rs/pull/11872#discussion_r4379770275
##########
arrow-select/src/filter.rs:
##########
@@ -1245,6 +1255,105 @@ fn filter_sparse_union(
})
}
+/// Sets the bits of `bytes` in the non-empty range `start..end`
+fn set_bit_range(bytes: &mut [u8], start: usize, end: usize) {
+ debug_assert!(start < end);
+ let (start_byte, end_byte) = (start / 8, end / 8);
+ let head = 0xFF << (start % 8);
+ let tail = !(0xFF << (end % 8));
+ if start_byte == end_byte {
+ bytes[start_byte] |= head & tail;
+ return;
+ }
+ bytes[start_byte] |= head;
+ bytes[start_byte + 1..end_byte].fill(0xFF);
+ if tail != 0 {
Review Comment:
nit: no need for the if, since `or`-ing with 0 is a no-op
##########
arrow-select/src/filter.rs:
##########
@@ -1245,6 +1255,105 @@ fn filter_sparse_union(
})
}
+/// Sets the bits of `bytes` in the non-empty range `start..end`
+fn set_bit_range(bytes: &mut [u8], start: usize, end: usize) {
+ debug_assert!(start < end);
+ let (start_byte, end_byte) = (start / 8, end / 8);
Review Comment:
could have been a shift (`>> 3`) but the compiler should make this
optimization anyway
--
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]