Skip to content

Commit 52a3dcd

Browse files
committed
Simplify equality checks in TransportSendOptions and RequestOptions classes
1 parent 257fcff commit 52a3dcd

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

kotlin-sdk-core/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/shared/Protocol.kt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,7 @@ public class RequestOptions(
132132

133133
other as RequestOptions
134134

135-
return when {
136-
onProgress != other.onProgress -> false
137-
timeout != other.timeout -> false
138-
else -> true
139-
}
135+
return onProgress == other.onProgress && timeout == other.timeout
140136
}
141137

142138
override fun hashCode(): Int {

kotlin-sdk-core/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/shared/TransportSendOptions.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,9 @@ public open class TransportSendOptions(
3333

3434
other as TransportSendOptions
3535

36-
return when {
37-
relatedRequestId != other.relatedRequestId -> false
38-
resumptionToken != other.resumptionToken -> false
39-
onResumptionToken != other.onResumptionToken -> false
40-
else -> true
41-
}
36+
return relatedRequestId == other.relatedRequestId &&
37+
resumptionToken == other.resumptionToken &&
38+
onResumptionToken == other.onResumptionToken
4239
}
4340

4441
override fun hashCode(): Int {

0 commit comments

Comments
 (0)