Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Unified Diff: tools/gn/function_foreach.cc

Issue 610293003: Replace more for loops in GN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/function_exec_script.cc ('k') | tools/gn/function_get_path_info.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/function_foreach.cc
diff --git a/tools/gn/function_foreach.cc b/tools/gn/function_foreach.cc
index 06a2dc17c156abac86ddb983defe7e88f2683d78..321bd0a0204904d5ffd53e013c693ebd07e1e590 100644
--- a/tools/gn/function_foreach.cc
+++ b/tools/gn/function_foreach.cc
@@ -101,8 +101,8 @@ Value RunForEach(Scope* scope,
if (old_loop_value_ptr)
old_loop_value = *old_loop_value_ptr;
- for (size_t i = 0; i < list.size(); i++) {
- scope->SetValue(loop_var, list[i], function);
+ for (const auto& cur : list) {
+ scope->SetValue(loop_var, cur, function);
block->ExecuteBlockInScope(scope, err);
if (err->has_error())
return Value();
« no previous file with comments | « tools/gn/function_exec_script.cc ('k') | tools/gn/function_get_path_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698