Skip to content

Commit 71336d0

Browse files
Use llvm::any_of (NFC)
1 parent d11103f commit 71336d0

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

clang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,10 +411,10 @@ bool MakeSmartPtrCheck::replaceNew(DiagnosticBuilder &Diag,
411411
// stop generating fixes -- as the C++ rule is complicated and we are less
412412
// certain about the correct fixes.
413413
if (const CXXRecordDecl *RD = New->getType()->getPointeeCXXRecordDecl()) {
414-
if (llvm::find_if(RD->ctors(), [](const CXXConstructorDecl *Ctor) {
414+
if (llvm::any_of(RD->ctors(), [](const CXXConstructorDecl *Ctor) {
415415
return Ctor->isCopyOrMoveConstructor() &&
416416
(Ctor->isDeleted() || Ctor->getAccess() == AS_private);
417-
}) != RD->ctor_end()) {
417+
})) {
418418
return false;
419419
}
420420
}

clang-tools-extra/clangd/AST.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -807,9 +807,8 @@ class ForwardingCallVisitor
807807
// Skip functions with less parameters, they can't be the target.
808808
if (Callee->parameters().size() < Parameters.size())
809809
return;
810-
if (std::any_of(Args.begin(), Args.end(), [](const Expr *E) {
811-
return dyn_cast<PackExpansionExpr>(E) != nullptr;
812-
})) {
810+
if (llvm::any_of(Args,
811+
[](const Expr *E) { return isa<PackExpansionExpr>(E); })) {
813812
return;
814813
}
815814
auto PackLocation = findPack(Args);

clang/lib/Format/FormatTokenLexer.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -515,10 +515,9 @@ bool FormatTokenLexer::tryMergeTokens(size_t Count, TokenType NewType) {
515515

516516
bool FormatTokenLexer::tryMergeTokensAny(
517517
ArrayRef<ArrayRef<tok::TokenKind>> Kinds, TokenType NewType) {
518-
return std::any_of(Kinds.begin(), Kinds.end(),
519-
[this, NewType](ArrayRef<tok::TokenKind> Kinds) {
520-
return tryMergeTokens(Kinds, NewType);
521-
});
518+
return llvm::any_of(Kinds, [this, NewType](ArrayRef<tok::TokenKind> Kinds) {
519+
return tryMergeTokens(Kinds, NewType);
520+
});
522521
}
523522

524523
// Returns \c true if \p Tok can only be followed by an operand in JavaScript.

0 commit comments

Comments
 (0)