diff --git a/CHANGELOG.md b/CHANGELOG.md index fd26cf597d0..915ebe28ae6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## 0.23.2 +* `Coroutines`: + * Small refactor in `AccumulatorFlow` to use `runCatching` instead of `runCatchingSafely` + ## 0.23.1 * `Versions`: diff --git a/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/AccumulatorFlow.kt b/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/AccumulatorFlow.kt index 8485228026c..eb299f8ca47 100644 --- a/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/AccumulatorFlow.kt +++ b/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/AccumulatorFlow.kt @@ -68,9 +68,9 @@ class AccumulatorFlow( override suspend fun collectSafely(collector: FlowCollector) { val channel = Channel(Channel.UNLIMITED, BufferOverflow.SUSPEND) steps.send(SubscribeAccumulatorFlowStep(channel)) - val result = runCatchingSafely { + val result = runCatching { for (data in channel) { - val emitResult = runCatchingSafely { + val emitResult = runCatching { collector.emit(data) } if (emitResult.isSuccess || emitResult.exceptionOrNull() is CancellationException) {