Skip to content

Commit 89ff110

Browse files
committed
[pa-combiner] Use llvm::any_of instead of a for loop.
1 parent 5acb59a commit 89ff110

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/SILOptimizer/Utils/PartialApplyCombiner.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,13 @@ bool PartialApplyCombiner::processSingleApply(FullApplySite paiAI) {
279279
SILInstruction *PartialApplyCombiner::combine() {
280280
// We need to model @unowned_inner_pointer better before we can do the
281281
// peephole here.
282-
for (auto resultInfo : pai->getSubstCalleeType()->getResults())
283-
if (resultInfo.getConvention() == ResultConvention::UnownedInnerPointer)
284-
return nullptr;
282+
if (llvm::any_of(pai->getSubstCalleeType()->getResults(),
283+
[](SILResultInfo resultInfo) {
284+
return resultInfo.getConvention() ==
285+
ResultConvention::UnownedInnerPointer;
286+
})) {
287+
return nullptr;
288+
}
285289

286290
// Iterate over all uses of the partial_apply
287291
// and look for applies that use it as a callee.

0 commit comments

Comments
 (0)