albertlockett commented on code in PR #9151:
URL: https://github.com/apache/arrow-rs/pull/9151#discussion_r2690214210


##########
arrow-buffer/src/buffer/boolean.rs:
##########
@@ -366,6 +366,20 @@ impl BooleanBuffer {
             .count_set_bits_offset(self.bit_offset, self.bit_len)
     }
 
+    /// Finds the position of the n-th set bit (1-based) starting from `start` 
index.
+    /// If fewer than `n` set bits are found, returns the length of the buffer.
+    pub fn find_nth_set_bit_position(self, start: usize, n: usize) -> usize {

Review Comment:
   Should this take `self`, or `& self`?
   
   I assume the intention is to use this in place of the 
`find_nth_set_bit_position` 
https://github.com/apache/arrow-rs/pull/8951/files#r2615576833
   
   And given where it's called, we don't own the array:
   
https://github.com/apache/arrow-rs/pull/8951/files#diff-7b82ae2ac7b9c8e09584ec0993eab786fef34b7bb28d6e3abde79ef566c4887fR325
   
   If this took a `&self` receiver, you could call it as 
`filter.values().find_nth_set_bit_position(filter_pos, to_copy)`



##########
arrow-buffer/src/buffer/boolean.rs:
##########
@@ -366,6 +366,20 @@ impl BooleanBuffer {
             .count_set_bits_offset(self.bit_offset, self.bit_len)
     }
 
+    /// Finds the position of the n-th set bit (1-based) starting from `start` 
index.
+    /// If fewer than `n` set bits are found, returns the length of the buffer.
+    pub fn find_nth_set_bit_position(self, start: usize, n: usize) -> usize {

Review Comment:
   Should this take `self`, or `&self` receiver?
   
   I assume the intention is to use this in place of the 
`find_nth_set_bit_position` 
https://github.com/apache/arrow-rs/pull/8951/files#r2615576833
   
   And given where it's called, we don't own the array:
   
https://github.com/apache/arrow-rs/pull/8951/files#diff-7b82ae2ac7b9c8e09584ec0993eab786fef34b7bb28d6e3abde79ef566c4887fR325
   
   If this took a `&self` receiver, you could call it as 
`filter.values().find_nth_set_bit_position(filter_pos, to_copy)`



-- 
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]

Reply via email to