Author: Kazu Hirata Date: 2024-02-03T21:43:06-08:00 New Revision: 34fba4fb1e32f06237e5024373cc0163cecc3fd5
URL: https://github.com/llvm/llvm-project/commit/34fba4fb1e32f06237e5024373cc0163cecc3fd5 DIFF: https://github.com/llvm/llvm-project/commit/34fba4fb1e32f06237e5024373cc0163cecc3fd5.diff LOG: [Basic] Use StringRef::contains (NFC) Added: Modified: clang/lib/Basic/Sarif.cpp Removed: ################################################################################ diff --git a/clang/lib/Basic/Sarif.cpp b/clang/lib/Basic/Sarif.cpp index 1cae7b937bc6e..8c144df341673 100644 --- a/clang/lib/Basic/Sarif.cpp +++ b/clang/lib/Basic/Sarif.cpp @@ -57,8 +57,7 @@ static std::string percentEncodeURICharacter(char C) { // should be written out directly. Otherwise, percent // encode the character and write that out instead of the // reserved character. - if (llvm::isAlnum(C) || - StringRef::npos != StringRef("-._~:@!$&'()*+,;=").find(C)) + if (llvm::isAlnum(C) || StringRef("-._~:@!$&'()*+,;=").contains(C)) return std::string(&C, 1); return "%" + llvm::toHex(StringRef(&C, 1)); } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits