Skip to content

Commit 7c85d58

Browse files
committed
InternalsHandler: Clean up NACK iterator
1 parent 961c98d commit 7c85d58

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/jvmMain/kotlin/org/golem/raknet/connection/InternalsHandler.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,8 @@ class InternalsHandler(
191191
// Queue up any packets that need to be resent
192192
nAcknowledge.records.forEach { record ->
193193
record.asList().forEach { index ->
194-
val frame = resendQueue[index]
195-
if(frame != null) {
196-
sendQueue.add(frame)
197-
} else {
198-
throw IllegalStateException("Frame not found in resend queue")
199-
}
194+
val frame = resendQueue[index] ?: throw IllegalStateException("Frame not found in resend queue")
195+
sendQueue.add(frame)
200196
}
201197
}
202198
}

0 commit comments

Comments
 (0)