Author: Kazu Hirata Date: 2024-02-04T14:57:30-08:00 New Revision: 92d5f644281cba56baa9b42dfc298db7f2c30003
URL: https://github.com/llvm/llvm-project/commit/92d5f644281cba56baa9b42dfc298db7f2c30003 DIFF: https://github.com/llvm/llvm-project/commit/92d5f644281cba56baa9b42dfc298db7f2c30003.diff LOG: [clang-tidy] Use StringRef::contains (NFC) Added: Modified: clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp Removed: ################################################################################ diff --git a/clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp b/clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp index e6f44dd51b459..5db9e99ab2370 100644 --- a/clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp @@ -658,7 +658,7 @@ std::string IdentifierNamingCheck::HungarianNotation::getEnumPrefix( const auto *ED = cast<EnumDecl>(ECD->getDeclContext()); std::string Name = ED->getName().str(); - if (std::string::npos != Name.find("enum")) { + if (StringRef(Name).contains("enum")) { Name = Name.substr(strlen("enum"), Name.length() - strlen("enum")); Name = Name.erase(0, Name.find_first_not_of(' ')); } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits