[clang] bfb026e - [StaticAnalyzer] Use StringRef::contains_insensitive (NFC)

Kazu Hirata via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 11 22:48:29 PST 2024


Author: Kazu Hirata
Date: 2024-01-11T22:48:19-08:00
New Revision: bfb026e17ce288cd446d19f5d6329d08b4f46e04

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

LOG: [StaticAnalyzer] Use StringRef::contains_insensitive (NFC)

Added: 
    

Modified: 
    clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp
index de9efe17d220b1..812d787e2e37c4 100644
--- a/clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp
@@ -712,7 +712,7 @@ void NonLocalizedStringChecker::setNonLocalizedState(const SVal S,
 
 
 static bool isDebuggingName(std::string name) {
-  return StringRef(name).lower().find("debug") != StringRef::npos;
+  return StringRef(name).contains_insensitive("debug");
 }
 
 /// Returns true when, heuristically, the analyzer may be analyzing debugging
@@ -1248,8 +1248,8 @@ bool PluralMisuseChecker::MethodCrawler::isCheckingPlurality(
           BO = B;
         }
       }
-      if (VD->getName().lower().find("plural") != StringRef::npos ||
-          VD->getName().lower().find("singular") != StringRef::npos) {
+      if (VD->getName().contains_insensitive("plural") ||
+          VD->getName().contains_insensitive("singular")) {
         return true;
       }
     }


        


More information about the cfe-commits mailing list