-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[clang-tidy][NFC] Remove unused parameter in function #164202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@llvm/pr-subscribers-clang-tidy Author: Victor Chernyakin (localspook) Changes82289aa refactored this function to not need this parameter. Full diff: https://github.com/llvm/llvm-project/pull/164202.diff 1 Files Affected:
diff --git a/clang-tools-extra/clang-tidy/ClangTidyCheck.cpp b/clang-tools-extra/clang-tidy/ClangTidyCheck.cpp
index d36cc3e6e23db..6e0c252a80bf8 100644
--- a/clang-tools-extra/clang-tidy/ClangTidyCheck.cpp
+++ b/clang-tools-extra/clang-tidy/ClangTidyCheck.cpp
@@ -90,12 +90,10 @@ ClangTidyCheck::OptionsView::getLocalOrGlobal(StringRef LocalName) const {
return std::nullopt;
}
-static std::optional<bool> getAsBool(StringRef Value,
- const llvm::Twine &LookupName) {
-
+static std::optional<bool> getAsBool(StringRef Value) {
if (std::optional<bool> Parsed = llvm::yaml::parseBool(Value))
return Parsed;
- // To maintain backwards compatability, we support parsing numbers as
+ // To maintain backwards compatibility, we support parsing numbers as
// booleans, even though its not supported in YAML.
long long Number = 0;
if (!Value.getAsInteger(10, Number))
@@ -107,7 +105,7 @@ template <>
std::optional<bool>
ClangTidyCheck::OptionsView::get<bool>(StringRef LocalName) const {
if (std::optional<StringRef> ValueOr = get(LocalName)) {
- if (auto Result = getAsBool(*ValueOr, NamePrefix + LocalName))
+ if (auto Result = getAsBool(*ValueOr))
return Result;
diagnoseBadBooleanOption(NamePrefix + LocalName, *ValueOr);
}
@@ -119,7 +117,7 @@ std::optional<bool>
ClangTidyCheck::OptionsView::getLocalOrGlobal<bool>(StringRef LocalName) const {
auto Iter = findPriorityOption(CheckOptions, NamePrefix, LocalName, Context);
if (Iter != CheckOptions.end()) {
- if (auto Result = getAsBool(Iter->getValue().Value, Iter->getKey()))
+ if (auto Result = getAsBool(Iter->getValue().Value))
return Result;
diagnoseBadBooleanOption(Iter->getKey(), Iter->getValue().Value);
}
|
|
@llvm/pr-subscribers-clang-tools-extra Author: Victor Chernyakin (localspook) Changes82289aa refactored this function to not need this parameter. Full diff: https://github.com/llvm/llvm-project/pull/164202.diff 1 Files Affected:
diff --git a/clang-tools-extra/clang-tidy/ClangTidyCheck.cpp b/clang-tools-extra/clang-tidy/ClangTidyCheck.cpp
index d36cc3e6e23db..6e0c252a80bf8 100644
--- a/clang-tools-extra/clang-tidy/ClangTidyCheck.cpp
+++ b/clang-tools-extra/clang-tidy/ClangTidyCheck.cpp
@@ -90,12 +90,10 @@ ClangTidyCheck::OptionsView::getLocalOrGlobal(StringRef LocalName) const {
return std::nullopt;
}
-static std::optional<bool> getAsBool(StringRef Value,
- const llvm::Twine &LookupName) {
-
+static std::optional<bool> getAsBool(StringRef Value) {
if (std::optional<bool> Parsed = llvm::yaml::parseBool(Value))
return Parsed;
- // To maintain backwards compatability, we support parsing numbers as
+ // To maintain backwards compatibility, we support parsing numbers as
// booleans, even though its not supported in YAML.
long long Number = 0;
if (!Value.getAsInteger(10, Number))
@@ -107,7 +105,7 @@ template <>
std::optional<bool>
ClangTidyCheck::OptionsView::get<bool>(StringRef LocalName) const {
if (std::optional<StringRef> ValueOr = get(LocalName)) {
- if (auto Result = getAsBool(*ValueOr, NamePrefix + LocalName))
+ if (auto Result = getAsBool(*ValueOr))
return Result;
diagnoseBadBooleanOption(NamePrefix + LocalName, *ValueOr);
}
@@ -119,7 +117,7 @@ std::optional<bool>
ClangTidyCheck::OptionsView::getLocalOrGlobal<bool>(StringRef LocalName) const {
auto Iter = findPriorityOption(CheckOptions, NamePrefix, LocalName, Context);
if (Iter != CheckOptions.end()) {
- if (auto Result = getAsBool(Iter->getValue().Value, Iter->getKey()))
+ if (auto Result = getAsBool(Iter->getValue().Value))
return Result;
diagnoseBadBooleanOption(Iter->getKey(), Iter->getValue().Value);
}
|
vbvictor
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you elaborate why it isn't needed anymore?
|
|
vbvictor
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
82289aa refactored this function to not need this parameter.
82289aa refactored this function to not need this parameter.
82289aa refactored this function to not need this parameter.
82289aa refactored this function to not need this parameter.
82289aa refactored this function to not need this parameter.