alamb commented on code in PR #7773:
URL: https://github.com/apache/arrow-rs/pull/7773#discussion_r2167701896
##########
arrow-array/src/array/byte_view_array.rs:
##########
@@ -734,12 +743,20 @@ where
}
impl<T: ByteViewType + ?Sized> From<GenericByteViewArray<T>> for ArrayData {
- fn from(mut array: GenericByteViewArray<T>) -> Self {
+ fn from(array: GenericByteViewArray<T>) -> Self {
let len = array.len();
- array.buffers.insert(0, array.views.into_inner());
+ let new_buffers = {
+ let mut buffers = Vec::with_capacity(array.buffers.len() + 1);
+ buffers.push(array.views.into_inner());
+ for buffer in array.buffers.iter() {
+ buffers.push(buffer.clone());
+ }
Review Comment:
How about
```rust
buffers.extend(array.buffers.iter().cloned())
```
--
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]