Skip to content

Commit c18c91f

Browse files
committed
Replace loop with llvm:any_of
1 parent 90beda2 commit c18c91f

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

clang/include/clang/AST/DeclContextInternals.h

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,10 @@ class StoredDeclsList {
176176
DeclListNode::Decls *Tail = erase_if([Decls](NamedDecl *ND) {
177177
if (ND->isFromASTFile())
178178
return true;
179-
// FIXME: Can we get rid of this loop completely?
180-
for (NamedDecl *D : Decls)
181-
// Only replace the local declaration if the external declaration has
182-
// higher visibilities.
183-
if (D->getModuleOwnershipKind() <= ND->getModuleOwnershipKind() &&
184-
D->declarationReplaces(ND, /*IsKnownNewer=*/false))
185-
return true;
186-
return false;
179+
return llvm::any_of(Decls, [ND](NamedDecl *D) {
180+
return D->getModuleOwnershipKind() <= ND->getModuleOwnershipKind() &&
181+
D->declarationReplaces(ND, /*IsKnownNewer=*/false);
182+
});
187183
});
188184

189185
// Don't have any pending external decls any more.

0 commit comments

Comments
 (0)