Skip to content

Commit 1c1a7a5

Browse files
committed
Properly end loop
1 parent a72c7b7 commit 1c1a7a5

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

paper/packet/src/main/kotlin/com/noxcrew/packet/PacketApi.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,8 @@ public class PacketApi(
239239
pendingTypes += input.javaClass
240240

241241
// Loop through all entries in the list with one type at a time
242-
// until we've handled all packets
243-
var madeChanges = false
244-
do {
242+
// until we've processed all types
243+
while (pendingTypes.isNotEmpty()) {
245244
// Determine the type we're checking for in this iteration!
246245
val type = pendingTypes.removeFirst()
247246
checkedTypes += type
@@ -282,7 +281,6 @@ public class PacketApi(
282281
pendingTypes += nestedType
283282
}
284283
}
285-
madeChanges = true
286284
} else {
287285
index++
288286
}
@@ -398,7 +396,7 @@ public class PacketApi(
398396
}
399397
}
400398
}
401-
} while (madeChanges)
399+
}
402400
return packets
403401
}
404402

0 commit comments

Comments
 (0)