From 494812a66086aacc6460ee1ca085fa620cc94587 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 26 Dec 2021 21:25:12 +0600 Subject: [PATCH] one more fix --- .../dev/inmo/micro_utils/fsm/common/dsl/FSMBuilder.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fsm/common/src/commonMain/kotlin/dev/inmo/micro_utils/fsm/common/dsl/FSMBuilder.kt b/fsm/common/src/commonMain/kotlin/dev/inmo/micro_utils/fsm/common/dsl/FSMBuilder.kt index d0378c88d0f..0668693b956 100644 --- a/fsm/common/src/commonMain/kotlin/dev/inmo/micro_utils/fsm/common/dsl/FSMBuilder.kt +++ b/fsm/common/src/commonMain/kotlin/dev/inmo/micro_utils/fsm/common/dsl/FSMBuilder.kt @@ -7,7 +7,7 @@ import kotlin.reflect.KClass class FSMBuilder( var statesManager: StatesManager = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()), - val fsmBuilder: (states: List>, statesManager: StatesManager) -> StatesMachine = { states, statesManager -> + val fsmBuilder: (statesManager: StatesManager, states: List>) -> StatesMachine = { statesManager, states -> StatesMachine( statesManager, states @@ -49,10 +49,10 @@ class FSMBuilder( } fun build() = fsmBuilder( + statesManager, states.toList().let { list -> defaultStateHandler ?.let { list + it.holder { true } } ?: list - }, - statesManager + } ) }