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

Unified Diff: tools/gn/binary_target_generator.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/args.cc ('k') | tools/gn/builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/binary_target_generator.cc
diff --git a/tools/gn/binary_target_generator.cc b/tools/gn/binary_target_generator.cc
index d73c76e3dab4da10c586a1a67b14349204cd3d1b..deee2161b58bfe89fa8652cce05c7a5b06305c06 100644
--- a/tools/gn/binary_target_generator.cc
+++ b/tools/gn/binary_target_generator.cc
@@ -118,17 +118,17 @@ bool BinaryTargetGenerator::FillAllowCircularIncludesFrom() {
return false;
// Validate that all circular includes entries are in the deps.
- for (size_t circular_i = 0; circular_i < circular.size(); circular_i++) {
+ for (const auto& cur : circular) {
bool found_dep = false;
for (const auto& dep_pair : target_->GetDeps(Target::DEPS_LINKED)) {
- if (dep_pair.label == circular[circular_i]) {
+ if (dep_pair.label == cur) {
found_dep = true;
break;
}
}
if (!found_dep) {
*err_ = Err(*value, "Label not in deps.",
- "The label \"" + circular[circular_i].GetUserVisibleName(false) +
+ "The label \"" + cur.GetUserVisibleName(false) +
"\"\nwas not in the deps of this target. "
"allow_circular_includes_from only allows\ntargets present in the "
"deps.");
@@ -137,7 +137,7 @@ bool BinaryTargetGenerator::FillAllowCircularIncludesFrom() {
}
// Add to the set.
- for (size_t i = 0; i < circular.size(); i++)
- target_->allow_circular_includes_from().insert(circular[i]);
+ for (const auto& cur : circular)
+ target_->allow_circular_includes_from().insert(cur);
return true;
}
« no previous file with comments | « tools/gn/args.cc ('k') | tools/gn/builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698