Author: Kazu Hirata
Date: 2024-01-30T22:12:08-08:00
New Revision: 2699c1d7007ea8001bfaae50de01ff33791ce958

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

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

Added: 
    

Modified: 
    clang-tools-extra/clang-tidy/bugprone/ReservedIdentifierCheck.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clang-tidy/bugprone/ReservedIdentifierCheck.cpp 
b/clang-tools-extra/clang-tidy/bugprone/ReservedIdentifierCheck.cpp
index 7a06df454be99..f6714d056518d 100644
--- a/clang-tools-extra/clang-tidy/bugprone/ReservedIdentifierCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/ReservedIdentifierCheck.cpp
@@ -104,7 +104,7 @@ static std::optional<std::string> 
getUnderscoreCapitalFixup(StringRef Name) {
 static bool startsWithUnderscoreInGlobalNamespace(StringRef Name,
                                                   bool IsInGlobalNamespace,
                                                   bool IsMacro) {
-  return !IsMacro && IsInGlobalNamespace && !Name.empty() && Name[0] == '_';
+  return !IsMacro && IsInGlobalNamespace && Name.starts_with("_");
 }
 
 static std::optional<std::string>


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to