diff --git a/fleet/util/core/srcCommonMain/fleet/util/List.kt b/fleet/util/core/srcCommonMain/fleet/util/List.kt deleted file mode 100644 index 162b9246eac4..000000000000 --- a/fleet/util/core/srcCommonMain/fleet/util/List.kt +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package fleet.util - -fun Iterable>.union(): Set = flatMapTo(mutableSetOf()) { it } - -//@fleet.kernel.plugins.InternalInPluginModules(where = ["fleet.util.test"]) -fun MutableList.updateGrouping( - beforeGroup: MutableList.(isOpening: Boolean) -> Unit = {}, - afterGroup: MutableList.(isClosing: Boolean) -> Unit = {}, - body: MutableList.(newGroup: () -> Unit) -> Unit, -) { - beforeGroup(true) - var count = size - var lastGroupEnd = size - body { - if (count < size) { - afterGroup(false) - lastGroupEnd = size - beforeGroup(false) - count = size - } - } - if (count == size) - while (size > lastGroupEnd) { removeLast() } - afterGroup(true) -} - -fun MutableList.updateSeparating( - separator: MutableList.() -> Unit = {}, - body: MutableList.(newGroup: () -> Unit) -> Unit, -) = updateGrouping( - beforeGroup = { isOpening -> if (!isOpening) separator() }, -) { newGroup -> - newGroup() - body(newGroup) -} \ No newline at end of file