alamb commented on code in PR #9016:
URL: https://github.com/apache/arrow-rs/pull/9016#discussion_r2636183730
##########
arrow-array/src/array/byte_view_array.rs:
##########
@@ -885,8 +896,11 @@ impl<T: ByteViewType + ?Sized> Array for
GenericByteViewArray<T> {
fn shrink_to_fit(&mut self) {
self.views.shrink_to_fit();
- self.buffers.iter_mut().for_each(|b| b.shrink_to_fit());
- self.buffers.shrink_to_fit();
+
+ if let Some(buffers) = Arc::get_mut(&mut self.buffers) {
Review Comment:
That makes sense -- let's keep it this way then. I do think it is worth a
comment explaining the rationale, though, for future readers that may wonder
the same thing
--
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]