jorgecarleitao commented on a change in pull request #8663:
URL: https://github.com/apache/arrow/pull/8663#discussion_r523452191
##########
File path: rust/arrow/src/buffer.rs
##########
@@ -270,6 +270,22 @@ impl Buffer {
BitChunks::new(&self, offset, len)
}
+ /// Returns the number of 1-bits in `data`
+ pub fn count_set_bits(&self) -> usize {
+ let len_in_bits = self.len() * 8;
+ self.count_set_bits_offset(0, len_in_bits)
Review comment:
This seems to ignore `self.offset` (it is on purpose, right?) If yes, do
you think that it makes sense to add a test verifying that the offset does not
impact this, maybe we already test that for `self.bit_chunks`?
##########
File path: rust/arrow/src/buffer.rs
##########
@@ -270,6 +270,22 @@ impl Buffer {
BitChunks::new(&self, offset, len)
}
+ /// Returns the number of 1-bits in `data`
Review comment:
End users do not know what `data` is. Maybe refer to "this buffer"
instead?
----------------------------------------------------------------
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]