vertexclique commented on a change in pull request #8664:
URL: https://github.com/apache/arrow/pull/8664#discussion_r526358664
##########
File path: rust/arrow/src/buffer.rs
##########
@@ -258,39 +259,52 @@ 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,
/// 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 && len % 8 == 0 {
- return self.slice(offset / 8);
+ #[inline]
+ pub fn bit_view(&self, offset_in_bits: usize, len_in_bits: usize) -> Self {
Review comment:
I am unsure about this suggestion tbh. Since it is giving a range and it
is not important to the user how it gives. It feels like it is important to
give a subview from the user's point of view rather than how it gives. Since
most of our code is relying on aligned access. Feels like the second paragraph
of the doc is mostly for us, arrow committers.
----------------------------------------------------------------
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:
[email protected]