alamb commented on code in PR #9193:
URL: https://github.com/apache/arrow-rs/pull/9193#discussion_r2701268987


##########
arrow-array/src/array/list_view_array.rs:
##########
@@ -607,18 +609,17 @@ impl<OffsetSize: OffsetSizeTrait> 
GenericListViewArray<OffsetSize> {
                 "{}ListViewArray's datatype must be {}ListViewArray(). It is 
{:?}",
                 OffsetSize::PREFIX,
                 OffsetSize::PREFIX,
-                data.data_type()
+                data_type
             )));
         }
 
         let values = make_array(values);
-        // ArrayData is valid, and verified type above
-        let value_offsets = ScalarBuffer::new(data.buffers()[0].clone(), 
data.offset(), data.len());
-        let value_sizes = ScalarBuffer::new(data.buffers()[1].clone(), 
data.offset(), data.len());
+        let value_offsets = ScalarBuffer::new(offsets_buffer, offset, len);
+        let value_sizes = ScalarBuffer::new(sizes_buffer, offset, len);
 
         Ok(Self {
-            data_type: data.data_type().clone(),

Review Comment:
   This saves a DataType::drop and a clone of NullBuffer -- probably not a huge 
deal but unecessary



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