[clang-tools-extra] 0f1721c - [clang-tidy] Use StringRef::contains (NFC)

Kazu Hirata via cfe-commits cfe-commits at lists.llvm.org
Sat Dec 23 22:30:09 PST 2023


Author: Kazu Hirata
Date: 2023-12-23T22:30:03-08:00
New Revision: 0f1721c480369bad1c8d3f9a664f8db6853f35fc

URL: https://github.com/llvm/llvm-project/commit/0f1721c480369bad1c8d3f9a664f8db6853f35fc
DIFF: https://github.com/llvm/llvm-project/commit/0f1721c480369bad1c8d3f9a664f8db6853f35fc.diff

LOG: [clang-tidy] Use StringRef::contains (NFC)

Added: 
    

Modified: 
    clang-tools-extra/clang-tidy/performance/InefficientAlgorithmCheck.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clang-tidy/performance/InefficientAlgorithmCheck.cpp b/clang-tools-extra/clang-tidy/performance/InefficientAlgorithmCheck.cpp
index 3c8751dbdd733f..ad900fcec2dee1 100644
--- a/clang-tools-extra/clang-tidy/performance/InefficientAlgorithmCheck.cpp
+++ b/clang-tools-extra/clang-tidy/performance/InefficientAlgorithmCheck.cpp
@@ -97,7 +97,7 @@ void InefficientAlgorithmCheck::check(const MatchFinder::MatchResult &Result) {
   if (!AlgDecl)
     return;
 
-  if (Unordered && AlgDecl->getName().find("bound") != llvm::StringRef::npos)
+  if (Unordered && AlgDecl->getName().contains("bound"))
     return;
 
   const auto *AlgParam = Result.Nodes.getNodeAs<Expr>("AlgParam");


        


More information about the cfe-commits mailing list