🐛 Set output of last-state merger to triggered
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 10 Feb 2024 08:16:32 +0000 (09:16 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 10 Feb 2024 08:16:32 +0000 (09:16 +0100)
src/main/kotlin/net/pterodactylus/rhynodge/mergers/LastStateMerger.kt

index 95f6e6b..eb851a2 100644 (file)
@@ -8,10 +8,6 @@ import net.pterodactylus.rhynodge.State
  */
 class LastStateMerger : Merger {
 
-       override fun mergeStates(previousState: State, currentState: State) = AlwaysTriggeringState(currentState)
-
-       class AlwaysTriggeringState(state: State) : State by state {
-               override fun triggered() = true
-       }
+       override fun mergeStates(previousState: State, currentState: State) = currentState.apply { trigger() }
 
 }