You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/10/04 16:49:41 UTC

[GitHub] jverce commented on a change in pull request #12356: [MXNET-860] Use modernized ranged loops where possible

jverce commented on a change in pull request #12356: [MXNET-860] Use modernized ranged loops where possible
URL: https://github.com/apache/incubator-mxnet/pull/12356#discussion_r222741979
 
 

 ##########
 File path: src/executor/graph_executor.cc
 ##########
 @@ -1130,8 +1130,7 @@ void GraphExecutor::InitCachedOps() {
 
     // the variables
     std::vector<Engine::VarHandle> use_vars, mutate_vars;
-    for (size_t i = 0; i < exec->in_array.size(); ++i) {
-      auto& nd = exec->in_array[i];
+    for (const auto& nd : exec->in_array) {
       use_vars.push_back(nd.var());
     }
     for (auto& r : exec->op_ctx.requested) {
 
 Review comment:
   `const auto& r` here maybe?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services