diff --git a/src/main/java/io/github/homchom/recode/util/coroutines/DerivedDispatcher.kt b/src/main/java/io/github/homchom/recode/util/coroutines/DerivedDispatcher.kt index 0b0ca178..144d2370 100644 --- a/src/main/java/io/github/homchom/recode/util/coroutines/DerivedDispatcher.kt +++ b/src/main/java/io/github/homchom/recode/util/coroutines/DerivedDispatcher.kt @@ -6,8 +6,8 @@ import kotlin.coroutines.CoroutineContext inline fun DerivedDispatcher(executor: Executor, crossinline immediatePredicate: () -> Boolean) = DerivedDispatcher( - { command -> - if (!immediatePredicate()) executor.execute(command) + { block -> + if (immediatePredicate()) block.run() else executor.execute(block) }, executor )