westonpace commented on code in PR #7596:
URL: https://github.com/apache/arrow-rs/pull/7596#discussion_r2886870244


##########
arrow-data/src/data.rs:
##########
@@ -551,11 +551,10 @@ impl ArrayData {
 
         if let DataType::Struct(_) = self.data_type() {
             // Slice into children
-            let new_offset = self.offset + offset;
             let new_data = ArrayData {
                 data_type: self.data_type().clone(),
                 len: length,
-                offset: new_offset,
+                offset: self.offset,

Review Comment:
   That does seem simpler.  It looks like `impl From<ArrayData> for 
StructArray` already pushes offsets into children so it isn't less work but it 
keeps the work in one spot instead of two as this entire if statement could be 
removed.
   
   Sorry though, I've been away from this for so long I don't even really 
remember the source issue.



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