From c700daabdc700ec57c0fabea13008d89f67da4ab Mon Sep 17 00:00:00 2001 From: Jan Korous Date: Mon, 12 Mar 2018 18:31:07 +0000 Subject: [PATCH] [NFC] Replace iterators in PrintHelp with range-based for llvm-svn: 327312 --- lib/Option/OptTable.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/Option/OptTable.cpp b/lib/Option/OptTable.cpp index 658129bef4b..022b9d5d933 100644 --- a/lib/Option/OptTable.cpp +++ b/lib/Option/OptTable.cpp @@ -537,8 +537,7 @@ void OptTable::PrintHelp(raw_ostream &OS, const char *Name, const char *Title, // Render help text into a map of group-name to a list of (option, help) // pairs. - using helpmap_ty = std::map>; - helpmap_ty GroupedOptionHelp; + std::map> GroupedOptionHelp; for (unsigned Id = 1, e = getNumOptions() + 1; Id != e; ++Id) { // FIXME: Split out option groups. @@ -567,11 +566,10 @@ void OptTable::PrintHelp(raw_ostream &OS, const char *Name, const char *Title, } } - for (helpmap_ty::iterator it = GroupedOptionHelp .begin(), - ie = GroupedOptionHelp.end(); it != ie; ++it) { - if (it != GroupedOptionHelp .begin()) + for (auto& OptionGroup : GroupedOptionHelp) { + if (OptionGroup.first != GroupedOptionHelp.begin()->first) OS << "\n"; - PrintHelpOptionList(OS, it->first, it->second); + PrintHelpOptionList(OS, OptionGroup.first, OptionGroup.second); } OS.flush();