From c3f8a97d0b1e542fd100ae4bd6d6a5dfd007a055 Mon Sep 17 00:00:00 2001 From: Youssef Shoaib Date: Mon, 7 Apr 2025 02:05:06 +0100 Subject: [PATCH] Remove vestigial safe call in jvm Exceptions.kt --- kotlinx-coroutines-core/jvm/src/Exceptions.kt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/kotlinx-coroutines-core/jvm/src/Exceptions.kt b/kotlinx-coroutines-core/jvm/src/Exceptions.kt index dafaaacbe3..58003ee8db 100644 --- a/kotlinx-coroutines-core/jvm/src/Exceptions.kt +++ b/kotlinx-coroutines-core/jvm/src/Exceptions.kt @@ -68,9 +68,6 @@ internal actual class JobCancellationException public actual constructor( other === this || other is JobCancellationException && other.message == message && other.job == job && other.cause == cause - override fun hashCode(): Int { - // since job is transient it is indeed nullable after deserialization - @Suppress("UNNECESSARY_SAFE_CALL") - return (message!!.hashCode() * 31 + (job?.hashCode() ?: 0)) * 31 + (cause?.hashCode() ?: 0) - } + override fun hashCode(): Int = + (message!!.hashCode() * 31 + job.hashCode()) * 31 + (cause?.hashCode() ?: 0) }