git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250613
91177308-0d34-0410-b5e6-
96231b3b80d8
/// Check whether the CPU string is valid.
bool isCPUStringValid(StringRef CPU) const {
- auto Found = std::find_if(ProcDesc.begin(), ProcDesc.end(),
- [=](const SubtargetFeatureKV &KV) {
- return CPU == KV.Key;
- });
- return Found != ProcDesc.end();
+ auto Found = std::lower_bound(ProcDesc.begin(), ProcDesc.end(), CPU);
+ return Found != ProcDesc.end() && StringRef(Found->Key) == CPU;
}
};