summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/CommandLine.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2016-06-17 18:59:41 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2016-06-17 18:59:41 +0000
commit4dea8f542b59973ea19f1826b6d18c99d7a047c1 (patch)
tree85665abd293ea9ee6be3895d646093c2428659db /llvm/lib/Support/CommandLine.cpp
parent28a9e7f4ba8d3bb8cca4d521f0089cd449227769 (diff)
downloadbcm5719-llvm-4dea8f542b59973ea19f1826b6d18c99d7a047c1.tar.gz
bcm5719-llvm-4dea8f542b59973ea19f1826b6d18c99d7a047c1.zip
Avoid duplicated map lookups. No functionality change intended.
llvm-svn: 273030
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
-rw-r--r--llvm/lib/Support/CommandLine.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp
index 9be0daada50..5ada72f9f94 100644
--- a/llvm/lib/Support/CommandLine.cpp
+++ b/llvm/lib/Support/CommandLine.cpp
@@ -1604,7 +1604,8 @@ protected:
E = SortedCategories.end();
Category != E; ++Category) {
// Hide empty categories for -help, but show for -help-hidden.
- bool IsEmptyCategory = CategorizedOptions[*Category].size() == 0;
+ const auto &CategoryOptions = CategorizedOptions[*Category];
+ bool IsEmptyCategory = CategoryOptions.empty();
if (!ShowHidden && IsEmptyCategory)
continue;
@@ -1625,11 +1626,8 @@ protected:
continue;
}
// Loop over the options in the category and print.
- for (std::vector<Option *>::const_iterator
- Opt = CategorizedOptions[*Category].begin(),
- E = CategorizedOptions[*Category].end();
- Opt != E; ++Opt)
- (*Opt)->printOptionInfo(MaxArgLen);
+ for (const Option *Opt : CategoryOptions)
+ Opt->printOptionInfo(MaxArgLen);
}
}
};
OpenPOWER on IntegriCloud