scovich commented on PR #9120: URL: https://github.com/apache/arrow-rs/pull/9120#issuecomment-3739144489
> > It seems like `BooleanBufferBuilder.finish()` has some small overhead (make a new MutableBuffer) which wasn't done previously so I updated the code to avoid doing that in [d8426fa](https://github.com/apache/arrow-rs/commit/d8426fae0fee97b029e48e53c4563cff04bcec4f) > > This seems... odd. A new `impl From<BooleanBufferBuilder> for NullBuffer` would seem to overlap strongly with `BooleanBufferBuilder::finish`. Tho actually, `impl From<BooleanBufferBuilder> for BooleanBuffer` is the weird one. What is `finish` required to do that `impl From` (producing the same type!) does _not_ need to do? Oh... `BooleanBufferBuilder::finish` takes `&mut self` and must allocate internal replacements for the consumed state, while `From` (as always) consumes `self`. Maybe it's worth documenting that pitfall on the `finish` method? I didn't even realize that `impl From` was a cheap/final alternative to `finish`, but it does make sense in retrospect. -- 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]
