mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-11 00:37:41 +00:00
fix: resolve Kotlin compiler warnings in quartz and quic
- Replace unused Unit/null expressions in statement-position when branches with empty blocks (CommandSerializer, QuicConnection, QuicConnectionParser, Http3FrameReader, WtPeerStreamDemux). - Suppress DEPRECATION on KindNames.names, which intentionally registers the deprecated GitReplyEvent and TorrentCommentEvent kinds for display. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018nqdy4VTLKidUWzGTJPja9
This commit is contained in:
@@ -326,6 +326,7 @@ data class KindName(
|
||||
* platform concern layered on top, never a fork of this data.
|
||||
*/
|
||||
object KindNames {
|
||||
@Suppress("DEPRECATION") // registry intentionally names deprecated kinds (GitReply, TorrentComment) for display
|
||||
val names: Map<Int, KindName> =
|
||||
mapOf(
|
||||
AcceptedBadgeSetEvent.KIND to KindName("Accepted Badge Set", "58"),
|
||||
|
||||
+1
-3
@@ -83,9 +83,7 @@ class CommandSerializer : StdSerializer<Command>(Command::class.java) {
|
||||
gen.writeString(cmd.subId)
|
||||
}
|
||||
|
||||
else -> {
|
||||
null
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
|
||||
gen.writeEndArray()
|
||||
|
||||
@@ -2523,9 +2523,7 @@ class QuicConnection(
|
||||
PathValidator.RecordResult.Stored,
|
||||
PathValidator.RecordResult.Duplicate,
|
||||
PathValidator.RecordResult.AlreadyRetired,
|
||||
-> {
|
||||
Unit
|
||||
}
|
||||
-> {}
|
||||
|
||||
PathValidator.RecordResult.PoolFull -> {
|
||||
// Peer over-issued past its own advertised
|
||||
@@ -2573,11 +2571,9 @@ class QuicConnection(
|
||||
// same path before the next outbound packet (which would
|
||||
// otherwise stamp a now-retired CID).
|
||||
when (val rotation = pathValidator.forceRotateToHigherSequence()) {
|
||||
null -> {
|
||||
Unit
|
||||
}
|
||||
|
||||
// active CID is still valid; nothing to do.
|
||||
null -> {}
|
||||
|
||||
PathValidator.ForcedRotationResult.NoSpareCid -> {
|
||||
// Watermark forced retirement of the active CID but
|
||||
// the pool is empty — we have nothing valid to use.
|
||||
@@ -2613,9 +2609,7 @@ class QuicConnection(
|
||||
when (val outcome = pathValidator.applyPathResponse(payload)) {
|
||||
PathValidator.ValidationOutcome.NotValidating,
|
||||
PathValidator.ValidationOutcome.PayloadMismatch,
|
||||
-> {
|
||||
Unit
|
||||
}
|
||||
-> {}
|
||||
|
||||
is PathValidator.ValidationOutcome.Validated -> {
|
||||
// Bug-7 fix: a valid PATH_RESPONSE proves the peer
|
||||
|
||||
+1
-3
@@ -852,9 +852,7 @@ private fun dispatchFrames(
|
||||
// peer knows it just violated the spec instead of
|
||||
// having its bytes silently dropped.
|
||||
when (stream.receive.insert(frame.offset, frame.data, frame.fin)) {
|
||||
com.vitorpamplona.quic.stream.ReceiveBuffer.InsertResult.OK -> {
|
||||
Unit
|
||||
}
|
||||
com.vitorpamplona.quic.stream.ReceiveBuffer.InsertResult.OK -> {}
|
||||
|
||||
com.vitorpamplona.quic.stream.ReceiveBuffer.InsertResult.OFFSET_PAST_FIN -> {
|
||||
conn.markClosedExternally(
|
||||
|
||||
@@ -165,9 +165,7 @@ class Http3FrameReader(
|
||||
)
|
||||
}
|
||||
when (context) {
|
||||
StreamContext.UNCHECKED -> {
|
||||
Unit
|
||||
}
|
||||
StreamContext.UNCHECKED -> {}
|
||||
|
||||
StreamContext.CONTROL -> {
|
||||
// §7.2.4: SETTINGS MUST be the first frame on the
|
||||
|
||||
@@ -491,9 +491,7 @@ class WtPeerStreamDemux(
|
||||
}
|
||||
|
||||
// no new requests; we don't enforce yet
|
||||
else -> {
|
||||
Unit
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user