Skip to content

Commit 0d7f66d

Browse files
[Sema] Use llvm::is_contained instead of llvm::all_of (NFC) (#158213)
The code in question uses llvm::all_of and llvm::identity to see if every pointer is nonnull: Ptr1 && Ptr2 && Ptr3 && ... This patch simplifies the expression by checking for the absence of nullptr with !llvm::is_contained.
1 parent b22a97d commit 0d7f66d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

clang/lib/Sema/HeuristicResolver.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include "clang/AST/ExprCXX.h"
1414
#include "clang/AST/TemplateBase.h"
1515
#include "clang/AST/Type.h"
16-
#include "llvm/ADT/identity.h"
1716

1817
namespace clang {
1918

@@ -562,7 +561,7 @@ HeuristicResolverImpl::getFunctionProtoTypeLoc(const Expr *Fn) {
562561
// In some edge cases the AST can contain a "trivial" FunctionProtoTypeLoc
563562
// which has null parameters. Avoid these as they don't contain useful
564563
// information.
565-
if (llvm::all_of(F.getParams(), llvm::identity<ParmVarDecl *>()))
564+
if (!llvm::is_contained(F.getParams(), nullptr))
566565
return F;
567566
}
568567

0 commit comments

Comments
 (0)