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

Unified Diff: tools/gn/function_get_target_outputs.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_get_path_info.cc ('k') | tools/gn/function_process_file_template.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/function_get_target_outputs.cc
diff --git a/tools/gn/function_get_target_outputs.cc b/tools/gn/function_get_target_outputs.cc
index e3a63eeca6b6b45dadc1366fa9d350988169d2cc..163b187d82049940c772f5b7db868d91c656ca42 100644
--- a/tools/gn/function_get_target_outputs.cc
+++ b/tools/gn/function_get_target_outputs.cc
@@ -92,8 +92,8 @@ Value RunGetTargetOutputs(Scope* scope,
*err = Err(function, "No targets defined in this context.");
return Value();
}
- for (size_t i = 0; i < collector->size(); i++) {
- const Item* item = (*collector)[i]->get();
+ for (const auto& cur : *collector) {
+ const Item* item = cur->get();
if (item->label() != label)
continue;
@@ -132,8 +132,8 @@ Value RunGetTargetOutputs(Scope* scope,
// Convert to Values.
Value ret(function, Value::LIST);
ret.list_value().reserve(files.size());
- for (size_t i = 0; i < files.size(); i++)
- ret.list_value().push_back(Value(function, files[i].value()));
+ for (const auto& file : files)
+ ret.list_value().push_back(Value(function, file.value()));
return ret;
}
« no previous file with comments | « tools/gn/function_get_path_info.cc ('k') | tools/gn/function_process_file_template.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698