Skip to content

Commit c8cdc46

Browse files
committed
[silgenpattern] Reduce indentation by inverting a condition.
1 parent 8675c37 commit c8cdc46

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

lib/SILGen/SILGenPattern.cpp

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2320,19 +2320,21 @@ void PatternMatchEmission::initSharedCaseBlockDest(CaseStmt *caseBlock,
23202320
result.first->second.first = block;
23212321

23222322
// Add args for any pattern variables
2323-
if (caseBlock->hasBoundDecls()) {
2324-
auto pattern = caseBlock->getCaseLabelItems()[0].getPattern();
2325-
pattern->forEachVariable([&](VarDecl *V) {
2326-
if (!V->hasName())
2327-
return;
2328-
2329-
// We don't pass address-only values in basic block arguments.
2330-
SILType ty = SGF.getLoweredType(V->getType());
2331-
if (ty.isAddressOnly(SGF.F.getModule()))
2332-
return;
2333-
block->createPhiArgument(ty, ValueOwnershipKind::Owned, V);
2334-
});
2323+
if (!caseBlock->hasBoundDecls()) {
2324+
return;
23352325
}
2326+
2327+
auto pattern = caseBlock->getCaseLabelItems()[0].getPattern();
2328+
pattern->forEachVariable([&](VarDecl *V) {
2329+
if (!V->hasName())
2330+
return;
2331+
2332+
// We don't pass address-only values in basic block arguments.
2333+
SILType ty = SGF.getLoweredType(V->getType());
2334+
if (ty.isAddressOnly(SGF.F.getModule()))
2335+
return;
2336+
block->createPhiArgument(ty, ValueOwnershipKind::Owned, V);
2337+
});
23362338
}
23372339

23382340
/// Retrieve the jump destination for a shared case block.

0 commit comments

Comments
 (0)