Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 96e46d0c authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[kairos] remove unnecessary suspend" into main

parents 832473c1 6b8b2904
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -167,7 +167,7 @@ internal class Network(val coroutineScope: CoroutineScope, val coalescingPolicy:
    }

    /** Evaluates [block] inside of a new transaction when the network is ready. */
    fun <R> transaction(reason: String, block: suspend EvalScope.() -> R): Deferred<R> =
    fun <R> transaction(reason: String, block: EvalScope.() -> R): Deferred<R> =
        CompletableDeferred<R>(parent = coroutineScope.coroutineContext.job).also { onResult ->
            if (!coroutineScope.isActive) {
                onResult.cancel()
@@ -290,11 +290,11 @@ internal class Network(val coroutineScope: CoroutineScope, val coalescingPolicy:
internal class ScheduledAction<T>(
    val reason: String,
    private val onResult: CompletableDeferred<T>? = null,
    private val onStartTransaction: suspend EvalScope.() -> T,
    private val onStartTransaction: EvalScope.() -> T,
) {
    private var result: Maybe<T> = Maybe.absent

    suspend fun started(evalScope: EvalScope) {
    fun started(evalScope: EvalScope) {
        result = Maybe.present(onStartTransaction(evalScope))
    }