itsjunetime commented on code in PR #6690:
URL: https://github.com/apache/arrow-rs/pull/6690#discussion_r1835162135
##########
arrow-buffer/src/buffer/immutable.rs:
##########
@@ -261,11 +261,11 @@ impl Buffer {
}
/// Returns a slice of this buffer starting at a certain bit offset.
- /// If the offset is byte-aligned the returned buffer is a shallow clone,
+ /// If the offset and length are byte-aligned the returned buffer is a
shallow clone,
/// otherwise a new buffer is allocated and filled with a copy of the bits
in the range.
pub fn bit_slice(&self, offset: usize, len: usize) -> Self {
- if offset % 8 == 0 {
- return self.slice(offset / 8);
+ if offset % 8 == 0 && len % 8 == 0 {
Review Comment:
I've moved this to #6707
--
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]