Skip to content

Commit 485a823

Browse files
committed
refactor: clean
1 parent 2f83f7d commit 485a823

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/main/kotlin/spp/protocol/instrument/LiveBreakpoint.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,19 +117,17 @@ data class LiveBreakpoint(
117117
/**
118118
* Specify explicitly so Kotlin doesn't override.
119119
*/
120+
@Suppress("RedundantOverride")
120121
override fun equals(other: Any?): Boolean = super.equals(other)
121122

122123
/**
123124
* Specify explicitly so Kotlin doesn't override.
124125
*/
126+
@Suppress("RedundantOverride")
125127
override fun hashCode(): Int = super.hashCode()
126128

127129
fun addHitListener(vertx: Vertx, listener: (LiveBreakpointHit) -> Unit) {
128-
val instrumentId = id
129-
if (instrumentId == null) {
130-
error("Instrument must be applied before adding a hit listener")
131-
}
132-
130+
val instrumentId = id ?: error("Instrument must be applied before adding a hit listener")
133131
vertx.eventBus().consumer<JsonObject>(toLiveInstrumentSubscription(instrumentId)).handler {
134132
val event = LiveInstrumentEvent.fromJson(it.body())
135133
if (event.eventType == LiveInstrumentEventType.BREAKPOINT_HIT) {

0 commit comments

Comments
 (0)