You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/01/05 21:40:38 UTC

[GitHub] [arrow] alamb commented on a change in pull request #9106: ARROW-11137: [Rust][DataFusion] Clippy needless_range_loop,needless_lifetimes

alamb commented on a change in pull request #9106:
URL: https://github.com/apache/arrow/pull/9106#discussion_r552215633



##########
File path: rust/datafusion/src/physical_plan/repartition.rs
##########
@@ -138,8 +138,8 @@ impl ExecutionPlan for RepartitionExec {
                     }
 
                     // notify each output partition that this input partition has no more data
-                    for i in 0..num_output_partitions {
-                        let tx = &mut channels[i].0;
+                    for channel in channels.iter_mut().take(num_output_partitions) {

Review comment:
       This can probably be even simpler as I think `channels` always has `num_output_partitions` elemements: 
   ```suggestion
                       for channel in channels.iter_mut() {
   ```
   
   But this PR's code is a correct as what was previously here :)




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org