parthchandra commented on code in PR #718: URL: https://github.com/apache/datafusion-comet/pull/718#discussion_r1696026034
########## 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 not read `len` bytes will it? Also `read_num_bytes_u64` appears to cover this case in an `unlikely` block (and handles it rather differently). ########## 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 { Review Comment: nit: should we use size_of instead of 8? -- 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