aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/CommandLine.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2021-01-01 12:44:54 -0800
committerKazu Hirata <kazu@google.com>2021-01-01 12:44:54 -0800
commitbea8d021a32d871f43909f892c8069137fb34bfa (patch)
tree72d9041063a5bbd1103d8ebf638773be99aed0ab /llvm/lib/Support/CommandLine.cpp
parentf43daf1b62af25d066893af02b4f67b9b8dd524e (diff)
downloadllvm-bea8d021a32d871f43909f892c8069137fb34bfa.zip
llvm-bea8d021a32d871f43909f892c8069137fb34bfa.tar.gz
llvm-bea8d021a32d871f43909f892c8069137fb34bfa.tar.bz2
[llvm] Use *Map::lookup (NFC)
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
-rw-r--r--llvm/lib/Support/CommandLine.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp
index 1b9436d..c8578f9 100644
--- a/llvm/lib/Support/CommandLine.cpp
+++ b/llvm/lib/Support/CommandLine.cpp
@@ -531,11 +531,7 @@ Option *CommandLineParser::LookupOption(SubCommand &Sub, StringRef &Arg,
// If we have an equals sign, remember the value.
if (EqualPos == StringRef::npos) {
// Look up the option.
- auto I = Sub.OptionsMap.find(Arg);
- if (I == Sub.OptionsMap.end())
- return nullptr;
-
- return I != Sub.OptionsMap.end() ? I->second : nullptr;
+ return Sub.OptionsMap.lookup(Arg);
}
// If the argument before the = is a valid option name and the option allows