@@ -90,12 +90,10 @@ ClangTidyCheck::OptionsView::getLocalOrGlobal(StringRef LocalName) const {
9090 return std::nullopt ;
9191}
9292
93- static std::optional<bool > getAsBool (StringRef Value,
94- const llvm::Twine &LookupName) {
95-
93+ static std::optional<bool > getAsBool (StringRef Value) {
9694 if (std::optional<bool > Parsed = llvm::yaml::parseBool (Value))
9795 return Parsed;
98- // To maintain backwards compatability , we support parsing numbers as
96+ // To maintain backwards compatibility , we support parsing numbers as
9997 // booleans, even though its not supported in YAML.
10098 long long Number = 0 ;
10199 if (!Value.getAsInteger (10 , Number))
@@ -107,7 +105,7 @@ template <>
107105std::optional<bool >
108106ClangTidyCheck::OptionsView::get<bool >(StringRef LocalName) const {
109107 if (std::optional<StringRef> ValueOr = get (LocalName)) {
110- if (auto Result = getAsBool (*ValueOr, NamePrefix + LocalName ))
108+ if (auto Result = getAsBool (*ValueOr))
111109 return Result;
112110 diagnoseBadBooleanOption (NamePrefix + LocalName, *ValueOr);
113111 }
@@ -119,7 +117,7 @@ std::optional<bool>
119117ClangTidyCheck::OptionsView::getLocalOrGlobal<bool >(StringRef LocalName) const {
120118 auto Iter = findPriorityOption (CheckOptions, NamePrefix, LocalName, Context);
121119 if (Iter != CheckOptions.end ()) {
122- if (auto Result = getAsBool (Iter->getValue ().Value , Iter-> getKey () ))
120+ if (auto Result = getAsBool (Iter->getValue ().Value ))
123121 return Result;
124122 diagnoseBadBooleanOption (Iter->getKey (), Iter->getValue ().Value );
125123 }
0 commit comments