Dandandan commented on code in PR #9229:
URL: https://github.com/apache/arrow-rs/pull/9229#discussion_r2708228686
##########
arrow-buffer/src/util/bit_iterator.rs:
##########
@@ -305,12 +305,12 @@ impl<'a> BitIndexIterator<'a> {
impl Iterator for BitIndexIterator<'_> {
type Item = usize;
- #[inline]
+ #[inline(always)]
fn next(&mut self) -> Option<Self::Item> {
loop {
if self.current_chunk != 0 {
let bit_pos = self.current_chunk.trailing_zeros();
- self.current_chunk ^= 1 << bit_pos;
+ self.current_chunk &= self.current_chunk - 1;
Review Comment:
This generates much more efficient code
--
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]