Skip to content

Commit 8aca536

Browse files
committed
[NFC] Use ASSERT() and silence unused variable warning
Comments in PR swiftlang#80438, where this code comes from, already suggest using ASSERT() instead of assert().
1 parent f9e71d6 commit 8aca536

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/swift/AST/Types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3583,13 +3583,13 @@ class AnyFunctionType : public TypeBase {
35833583
Bits.AnyFunctionType.NumParams = NumParams;
35843584
assert(Bits.AnyFunctionType.NumParams == NumParams && "Params dropped!");
35853585

3586-
if (Info) {
3586+
if (Info && CONDITIONAL_ASSERT_enabled()) {
35873587
unsigned maxLifetimeTarget = NumParams + 1;
35883588
if (auto outputFn = Output->getAs<AnyFunctionType>()) {
35893589
maxLifetimeTarget += outputFn->getNumParams();
35903590
}
35913591
for (auto &dep : Info->getLifetimeDependencies()) {
3592-
assert(dep.getTargetIndex() < maxLifetimeTarget);
3592+
ASSERT(dep.getTargetIndex() < maxLifetimeTarget);
35933593
}
35943594
}
35953595
}

0 commit comments

Comments
 (0)