Rich-T-kid commented on code in PR #10438:
URL: https://github.com/apache/arrow-rs/pull/10438#discussion_r3652768500
##########
arrow-array/src/array/boolean_array.rs:
##########
@@ -593,10 +593,22 @@ impl BooleanArray {
return self;
};
- let mut builder = BooleanBufferBuilder::new(len);
- builder.append_buffer(&self.values.slice(0, end));
- builder.append_n(len - end, false);
- BooleanArray::new(builder.finish(), self.nulls)
+ let mut_buffer_result = self.values.into_inner().into_mutable();
+ match mut_buffer_result {
+ Ok(mut mutable_buffer) => {
+ for i in end..len {
+ bit_util::unset_bit(mutable_buffer.as_slice_mut(), i);
+ }
Review Comment:
Im sure there a faster ways to do this. I looked up a few ways to do this
and im not too familar with bit operations so I left is as a basic loop for now
--
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]