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

Unified Diff: tools/gn/function_exec_script.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/err.cc ('k') | tools/gn/function_foreach.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/function_exec_script.cc
diff --git a/tools/gn/function_exec_script.cc b/tools/gn/function_exec_script.cc
index ce697e51cb3cfe202eeb2acd5312fccbd6351ed7..eb30a6ec399b64aac6ddad66441fdf03baf4aebf 100644
--- a/tools/gn/function_exec_script.cc
+++ b/tools/gn/function_exec_script.cc
@@ -325,12 +325,12 @@ Value RunExecScript(Scope* scope,
if (!deps_value.VerifyTypeIs(Value::LIST, err))
return Value();
- for (size_t i = 0; i < deps_value.list_value().size(); i++) {
- if (!deps_value.list_value()[0].VerifyTypeIs(Value::STRING, err))
+ for (const auto& dep : deps_value.list_value()) {
+ if (!dep.VerifyTypeIs(Value::STRING, err))
return Value();
g_scheduler->AddGenDependency(
build_settings->GetFullPath(cur_dir.ResolveRelativeFile(
- deps_value.list_value()[0].string_value())));
+ dep.string_value())));
}
}
@@ -344,10 +344,10 @@ Value RunExecScript(Scope* scope,
const Value& script_args = args[1];
if (!script_args.VerifyTypeIs(Value::LIST, err))
return Value();
- for (size_t i = 0; i < script_args.list_value().size(); i++) {
- if (!script_args.list_value()[i].VerifyTypeIs(Value::STRING, err))
+ for (const auto& arg : script_args.list_value()) {
+ if (!arg.VerifyTypeIs(Value::STRING, err))
return Value();
- cmdline.AppendArg(script_args.list_value()[i].string_value());
+ cmdline.AppendArg(arg.string_value());
}
}
« no previous file with comments | « tools/gn/err.cc ('k') | tools/gn/function_foreach.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698