jorgecarleitao commented on a change in pull request #416: URL: https://github.com/apache/arrow-rs/pull/416#discussion_r646930397
########## File path: arrow/src/util/bit_chunk_iterator.rs ########## @@ -137,14 +137,16 @@ impl Iterator for BitChunkIterator<'_> { // so when reading as u64 on a big-endian machine, the bytes need to be swapped let current = unsafe { std::ptr::read_unaligned(raw_data.add(index)).to_le() }; - let combined = if self.bit_offset == 0 { + let bit_offset = self.bit_offset; + + let combined = if bit_offset == 0 { current } else { - let next = - unsafe { std::ptr::read_unaligned(raw_data.add(index + 1)).to_le() }; + let next = unsafe { + std::ptr::read_unaligned(raw_data.add(index + 1) as *const u8) as u64 Review comment: You are right 👍 Good thinking. Thanks for the clarification. -- 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: us...@infra.apache.org