From c72982f95d0695e508378f07d9285e6b3f8a7d29 Mon Sep 17 00:00:00 2001 From: Colin White Date: Mon, 18 Nov 2024 15:49:09 -0800 Subject: [PATCH] Fix tests. --- coil-core/src/commonMain/kotlin/coil3/util/utils.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/coil-core/src/commonMain/kotlin/coil3/util/utils.kt b/coil-core/src/commonMain/kotlin/coil3/util/utils.kt index 096a60d10..df62f474b 100644 --- a/coil-core/src/commonMain/kotlin/coil3/util/utils.kt +++ b/coil-core/src/commonMain/kotlin/coil3/util/utils.kt @@ -123,12 +123,12 @@ object InternalCoilUtils { } fun resolveImmediateDispatcher(context: CoroutineContext): CoroutineContext { - var dispatcher: CoroutineContext? = context[CoroutineDispatcher] + var dispatcher = context[CoroutineDispatcher] if (dispatcher is MainCoroutineDispatcher) { try { - dispatcher = dispatcher.immediate + return dispatcher.immediate } catch (_: UnsupportedOperationException) {} } - return dispatcher ?: immediateDispatcher + return immediateDispatcher } }