Skip to content

Commit bcb08d0

Browse files
committed
Replaced an if statement with an assertion in GenKeyPath
1 parent 6a462b1 commit bcb08d0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/IRGen/GenKeyPath.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,10 +1107,8 @@ emitKeyPathComponent(IRGenModule &IGM,
11071107
fields.addInt32(KeyPathComponentHeader::forOptionalWrap().getData());
11081108
break;
11091109
case KeyPathPatternComponent::Kind::TupleElement:
1110-
if (!baseTy->is<TupleType>()) {
1111-
llvm_unreachable("not a tuple");
1112-
}
1113-
1110+
assert(baseTy->is<TupleType>() && "not a tuple");
1111+
11141112
SILType loweredTy = IGM.getSILTypes().getLoweredType(baseTy);
11151113

11161114
if (auto offset = getFixedTupleElementOffset(IGM, loweredTy, component.getTupleIndex())) {

0 commit comments

Comments
 (0)