liamzwbao commented on issue #7383:
URL: https://github.com/apache/arrow-rs/issues/7383#issuecomment-3105523896

   Hi @alamb and @Dandandan, I'm looking into this issue and wanted to clarify 
what you meant by "using `Vec` directly." From what I see, the code is already 
using a `Vec`, so I assume you're suggesting a refactor like this:
   ```rust
   let mut intermediate = Vec::with_capacity(offsets.len() - 1);
   for &offset in &offsets[1..] {
       intermediate.push(offset + shift);
   }
   ```
   to use extend
   ```rust
   let mut intermediate = Vec::with_capacity(offsets.len() - 1);
   intermediate.extend(offsets[1..].iter().map(|&offset| offset + shift));
   ```
   so that the code is more concise and the performance may improve.
   
   Am I right? Thanks!
   


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