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

Unified Diff: tools/gn/standard_out.cc

Issue 986113002: tools/gn: Convert for loops to use the new range-based loops in C++11. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more fixes Created 5 years, 9 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
Index: tools/gn/standard_out.cc
diff --git a/tools/gn/standard_out.cc b/tools/gn/standard_out.cc
index b318fe477a9cb50914c374121dfc4b5329ccda92..69d443be368a22f37b8f1ca4eee2c6fe642dbaeb 100644
--- a/tools/gn/standard_out.cc
+++ b/tools/gn/standard_out.cc
@@ -179,12 +179,12 @@ void PrintLongHelp(const std::string& text) {
// Check for a comment.
TextDecoration dec = DECORATION_NONE;
- for (size_t char_i = 0; char_i < line.size(); char_i++) {
- if (line[char_i] == '#') {
+ for (const auto& elem : line) {
+ if (elem == '#') {
// Got a comment, draw dimmed.
dec = DECORATION_DIM;
break;
- } else if (line[char_i] != ' ') {
+ } else if (elem != ' ') {
break;
}
}
« tools/gn/pattern.cc ('K') | « tools/gn/pattern.cc ('k') | tools/gn/substitution_pattern.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698