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

Unified Diff: tools/gn/commands.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/command_refs.cc ('k') | tools/gn/err.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/commands.cc
diff --git a/tools/gn/commands.cc b/tools/gn/commands.cc
index 6dde4b25cf9c6feedb1807e53c9839a25d523eb7..0ad1bd77b1051dd1e803aa072cbb15564bd3ee9d 100644
--- a/tools/gn/commands.cc
+++ b/tools/gn/commands.cc
@@ -113,9 +113,9 @@ bool ResolveTargetsFromCommandLinePattern(
std::vector<const Target*> all_targets =
setup->builder()->GetAllResolvedTargets();
- for (size_t i = 0; i < all_targets.size(); i++) {
- if (pattern.Matches(all_targets[i]->label()))
- matches->push_back(all_targets[i]);
+ for (const auto& target : all_targets) {
+ if (pattern.Matches(target->label()))
+ matches->push_back(target);
}
return true;
}
« no previous file with comments | « tools/gn/command_refs.cc ('k') | tools/gn/err.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698