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

Unified Diff: tools/gn/command_help.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_desc.cc ('k') | tools/gn/command_ls.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/command_help.cc
diff --git a/tools/gn/command_help.cc b/tools/gn/command_help.cc
index ef5f70bcca0b02e8e14a461a5f3ce44199f309e4..d20757271a48e81948b6c731a11637a554d61799 100644
--- a/tools/gn/command_help.cc
+++ b/tools/gn/command_help.cc
@@ -22,11 +22,8 @@ namespace {
void PrintToplevelHelp() {
OutputString("Commands (type \"gn help <command>\" for more details):\n");
-
- const commands::CommandInfoMap& command_map = commands::GetCommands();
- for (commands::CommandInfoMap::const_iterator i = command_map.begin();
- i != command_map.end(); ++i)
- PrintShortHelp(i->second.help_short);
+ for (const auto& cmd : commands::GetCommands())
+ PrintShortHelp(cmd.second.help_short);
OutputString(
"\n"
@@ -56,39 +53,30 @@ void PrintToplevelHelp() {
// Target declarations.
OutputString("\nTarget declarations (type \"gn help <function>\" for more "
"details):\n");
- const functions::FunctionInfoMap& function_map = functions::GetFunctions();
- for (functions::FunctionInfoMap::const_iterator i = function_map.begin();
- i != function_map.end(); ++i) {
- if (i->second.is_target)
- PrintShortHelp(i->second.help_short);
+ for (const auto& func : functions::GetFunctions()) {
+ if (func.second.is_target)
+ PrintShortHelp(func.second.help_short);
}
// Functions.
OutputString("\nBuildfile functions (type \"gn help <function>\" for more "
"details):\n");
- for (functions::FunctionInfoMap::const_iterator i = function_map.begin();
- i != function_map.end(); ++i) {
- if (!i->second.is_target)
- PrintShortHelp(i->second.help_short);
+ for (const auto& func : functions::GetFunctions()) {
+ if (!func.second.is_target)
+ PrintShortHelp(func.second.help_short);
}
// Built-in variables.
OutputString("\nBuilt-in predefined variables (type \"gn help <variable>\" "
"for more details):\n");
- const variables::VariableInfoMap& builtin_vars =
- variables::GetBuiltinVariables();
- for (variables::VariableInfoMap::const_iterator i = builtin_vars.begin();
- i != builtin_vars.end(); ++i)
- PrintShortHelp(i->second.help_short);
+ for (const auto& builtin : variables::GetBuiltinVariables())
+ PrintShortHelp(builtin.second.help_short);
// Target variables.
OutputString("\nVariables you set in targets (type \"gn help <variable>\" "
"for more details):\n");
- const variables::VariableInfoMap& target_vars =
- variables::GetTargetVariables();
- for (variables::VariableInfoMap::const_iterator i = target_vars.begin();
- i != target_vars.end(); ++i)
- PrintShortHelp(i->second.help_short);
+ for (const auto& target : variables::GetTargetVariables())
+ PrintShortHelp(target.second.help_short);
OutputString("\nOther help topics:\n");
PrintShortHelp("buildargs: How build arguments work.");
« no previous file with comments | « tools/gn/command_desc.cc ('k') | tools/gn/command_ls.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698