Upgrade ktlint to 0.48.2

This commit is contained in:
Benoit Marty 2023-04-17 15:17:44 +02:00 committed by Benoit Marty
parent 200763e15a
commit ff36c461b5
5 changed files with 13 additions and 34 deletions

View file

@ -64,7 +64,7 @@ class StateMachine<Event : Any, State : Any>(
val routesForEvent = routes.filter { it.eventType.isInstance(event) }
return (routesForEvent.firstOrNull { it.fromState?.isInstance(currentState) == true }
?: routesForEvent.firstOrNull { it.fromState == null }) as? StateMachineRoute<E, State, State>
?: routesForEvent.firstOrNull { it.fromState == null }) as? StateMachineRoute<E, State, State>
}
fun restart() {
@ -129,7 +129,7 @@ class StateMachineBuilder<Event : Any, State : Any>(
newRoutes: List<StateMachineRoute<*, *, *>>,
) {
val oldEvents = oldRoutes.filter { it.fromState == state }.map { it.eventType }
val newEvents = newRoutes.filter { it.fromState == state }.map { it.eventType }
val newEvents = newRoutes.filter { it.fromState == state }.map { it.eventType }
val intersection = oldEvents.intersect(newEvents)
if (intersection.isNotEmpty()) {
val duplicates = intersection.joinToString(", ") { it.name }