[clang-tools-extra] 1dd8a31 - [clang-tidy] Use is_contained (NFC)
Kazu Hirata via cfe-commits
cfe-commits at lists.llvm.org
Sun Aug 7 23:55:53 PDT 2022
Author: Kazu Hirata
Date: 2022-08-07T23:55:25-07:00
New Revision: 1dd8a318544bdf4d06b337340d678df06e4f2f0a
URL: https://github.com/llvm/llvm-project/commit/1dd8a318544bdf4d06b337340d678df06e4f2f0a
DIFF: https://github.com/llvm/llvm-project/commit/1dd8a318544bdf4d06b337340d678df06e4f2f0a.diff
LOG: [clang-tidy] Use is_contained (NFC)
Added:
Modified:
clang-tools-extra/clang-tidy/bugprone/MoveForwardingReferenceCheck.cpp
clang-tools-extra/clang-tidy/objc/NSDateFormatterCheck.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/clang-tidy/bugprone/MoveForwardingReferenceCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/MoveForwardingReferenceCheck.cpp
index 90b35df09f3d..f4ff4a9a744b 100644
--- a/clang-tools-extra/clang-tidy/bugprone/MoveForwardingReferenceCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/MoveForwardingReferenceCheck.cpp
@@ -112,7 +112,7 @@ void MoveForwardingReferenceCheck::check(
// template as the function parameter of that type. (This implies that type
// deduction will happen on the type.)
const TemplateParameterList *Params = FuncTemplate->getTemplateParameters();
- if (!std::count(Params->begin(), Params->end(), TypeParmDecl))
+ if (!llvm::is_contained(*Params, TypeParmDecl))
return;
auto Diag = diag(CallMove->getExprLoc(),
diff --git a/clang-tools-extra/clang-tidy/objc/NSDateFormatterCheck.cpp b/clang-tools-extra/clang-tidy/objc/NSDateFormatterCheck.cpp
index fdc837704a69..e5424c98a72a 100644
--- a/clang-tools-extra/clang-tidy/objc/NSDateFormatterCheck.cpp
+++ b/clang-tools-extra/clang-tidy/objc/NSDateFormatterCheck.cpp
@@ -40,9 +40,7 @@ static char ValidDatePatternChars[] = {
bool isValidDatePattern(StringRef Pattern) {
for (auto &PatternChar : Pattern) {
if (isalpha(PatternChar)) {
- if (std::find(std::begin(ValidDatePatternChars),
- std::end(ValidDatePatternChars),
- PatternChar) == std::end(ValidDatePatternChars)) {
+ if (!llvm::is_contained(ValidDatePatternChars, PatternChar)) {
return false;
}
}
More information about the cfe-commits
mailing list