Skip to content
Snippets Groups Projects
Commit f686213d authored by Craig Topper's avatar Craig Topper
Browse files

Replace a static compare function with a lambda. NFC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250621 91177308-0d34-0410-b5e6-96231b3b80d8
parent 067bdf15
No related branches found
No related tags found
No related merge requests found
......@@ -503,10 +503,6 @@ static const WarningOption OptionTable[] = {
#undef GET_DIAG_TABLE
};
static bool WarningOptionCompare(const WarningOption &LHS, StringRef RHS) {
return LHS.getName() < RHS;
}
/// getWarningOptionForDiag - Return the lowest-level warning option that
/// enables the specified diagnostic. If there is no -Wfoo flag that controls
/// the diagnostic, this returns null.
......@@ -549,9 +545,11 @@ static bool getDiagnosticsInGroup(diag::Flavor Flavor,
bool
DiagnosticIDs::getDiagnosticsInGroup(diag::Flavor Flavor, StringRef Group,
SmallVectorImpl<diag::kind> &Diags) const {
const WarningOption *Found = std::lower_bound(std::begin(OptionTable),
std::end(OptionTable),
Group, WarningOptionCompare);
auto Found = std::lower_bound(std::begin(OptionTable), std::end(OptionTable),
Group,
[](const WarningOption &LHS, StringRef RHS) {
return LHS.getName() < RHS;
});
if (Found == std::end(OptionTable) || Found->getName() != Group)
return true; // Option not found.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment