Replace usages of StringRef.find(Key) != StringRef::npos to StringRef.contains(Key)

This commit is contained in:
Minhyuk Kim
2020-12-29 00:09:16 +09:00
parent 187f4dbaf8
commit e924cf6104
19 changed files with 31 additions and 41 deletions

View File

@@ -2291,8 +2291,7 @@ int swift::ide::api::findDeclUsr(StringRef dumpPath, CheckerOptions Opts) {
FinderByLocation(StringRef Location): Location(Location) {}
void visit(SDKNode* Node) override {
if (auto *D = dyn_cast<SDKNodeDecl>(Node)) {
if (D->getLocation().find(Location) != StringRef::npos &&
!D->getUsr().empty()) {
if (D->getLocation().contains(Location) && !D->getUsr().empty()) {
llvm::outs() << D->getFullyQualifiedName() << ": " << D->getUsr() << "\n";
}
}