kazuyukitanimura commented on code in PR #718: URL: https://github.com/apache/datafusion-comet/pull/718#discussion_r1696093684
########## native/core/src/common/bit.rs: ########## @@ -553,8 +564,11 @@ pub struct BitReader { /// either byte aligned or not. impl BitReader { pub fn new(buf: Buffer, len: usize) -> Self { - let num_bytes = cmp::min(8, len); - let buffered_values = read_num_bytes_u64(num_bytes, buf.as_slice()); + let buffered_values = if 8 > len { + read_num_bytes_u64(len, buf.as_slice()) + } else { + read_u64(buf.as_slice()) Review Comment: If `len > 8` then, this will read 8 bytes only (u64). `read_num_bytes_u64` has ``` debug_assert!(size <= src.len()); if unlikely(src.len() < 8) { ``` So when `size=8` we do not need the `if unlikely()` block -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org