diff options
author | Kazu Hirata <kazu@google.com> | 2023-05-16 10:12:42 -0700 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2023-05-16 10:12:42 -0700 |
commit | ed1539c6ad3d2c6e888985d21f841504f69beab3 (patch) | |
tree | b66a52d786b827ac64042e38cdf8bc14688dfc21 /clang-tools-extra/clang-tidy | |
parent | 4107898839c37bc7e5501fc313282d40719b0bc6 (diff) | |
download | llvm-ed1539c6ad3d2c6e888985d21f841504f69beab3.tar.gz |
Migrate {starts,ends}with_insensitive to {starts,ends}_with_insensitive (NFC)
This patch migrates uses of StringRef::{starts,ends}with_insensitive
to StringRef::{starts,ends}_with_insensitive so that we can use names
similar to those used in std::string_view.
Note that the llvm/ directory has migrated in commit
6c3ea866e93003e16fc55d3b5cedd3bc371d1fde.
I'll post a separate patch to deprecate
StringRef::{starts,ends}with_insensitive.
Differential Revision: https://reviews.llvm.org/D150506
Diffstat (limited to 'clang-tools-extra/clang-tidy')
-rw-r--r-- | clang-tools-extra/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp | 4 | ||||
-rw-r--r-- | clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/clang-tools-extra/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp b/clang-tools-extra/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp index 13031e7cc14b..c41f81b0f0b5 100644 --- a/clang-tools-extra/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp @@ -91,8 +91,8 @@ bool nameMatch(StringRef L, StringRef R, bool Strict) { return L.empty() || R.empty() || L == R; // We allow two names if one is a prefix/suffix of the other, ignoring case. // Important special case: this is true if either parameter has no name! - return L.startswith_insensitive(R) || R.startswith_insensitive(L) || - L.endswith_insensitive(R) || R.endswith_insensitive(L); + return L.starts_with_insensitive(R) || R.starts_with_insensitive(L) || + L.ends_with_insensitive(R) || R.ends_with_insensitive(L); } DifferingParamsContainer diff --git a/clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp b/clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp index 14bf22a4d420..bfca8c3b6c3d 100644 --- a/clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp @@ -154,7 +154,7 @@ static bool applyPrefixHeuristic(StringRef Arg, StringRef Param, StringRef Shorter = Arg.size() < Param.size() ? Arg : Param; StringRef Longer = Arg.size() >= Param.size() ? Arg : Param; - if (Longer.startswith_insensitive(Shorter)) + if (Longer.starts_with_insensitive(Shorter)) return percentage(Shorter.size(), Longer.size()) > Threshold; return false; @@ -166,7 +166,7 @@ static bool applySuffixHeuristic(StringRef Arg, StringRef Param, StringRef Shorter = Arg.size() < Param.size() ? Arg : Param; StringRef Longer = Arg.size() >= Param.size() ? Arg : Param; - if (Longer.endswith_insensitive(Shorter)) + if (Longer.ends_with_insensitive(Shorter)) return percentage(Shorter.size(), Longer.size()) > Threshold; return false; |