From 69df2a35f2c003e6034520b15f9a573fd7998445 Mon Sep 17 00:00:00 2001 From: Dmitry Nekrasov Date: Tue, 7 Oct 2025 13:08:01 +0400 Subject: [PATCH] Remove unused imports and simplify class hierarchy in PersistentVector and SmallPersistentVector --- .../src/implementations/immutableList/PersistentVector.kt | 3 +-- .../implementations/immutableList/SmallPersistentVector.kt | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/core/commonMain/src/implementations/immutableList/PersistentVector.kt b/core/commonMain/src/implementations/immutableList/PersistentVector.kt index d902297c..7f7e805e 100644 --- a/core/commonMain/src/implementations/immutableList/PersistentVector.kt +++ b/core/commonMain/src/implementations/immutableList/PersistentVector.kt @@ -9,7 +9,6 @@ import kotlinx.collections.immutable.PersistentList import kotlinx.collections.immutable.internal.ListImplementation.checkElementIndex import kotlinx.collections.immutable.internal.ListImplementation.checkPositionIndex import kotlinx.collections.immutable.internal.assert -import kotlinx.collections.immutable.mutate /** * Persistent vector made of a trie of leaf buffers entirely filled with [MAX_BUFFER_SIZE] elements and a tail having @@ -24,7 +23,7 @@ import kotlinx.collections.immutable.mutate internal class PersistentVector(private val root: Array, private val tail: Array, override val size: Int, - private val rootShift: Int) : PersistentList, AbstractPersistentList() { + private val rootShift: Int) : AbstractPersistentList() { init { require(size > MAX_BUFFER_SIZE) { "Trie-based persistent vector should have at least ${MAX_BUFFER_SIZE + 1} elements, got $size" } diff --git a/core/commonMain/src/implementations/immutableList/SmallPersistentVector.kt b/core/commonMain/src/implementations/immutableList/SmallPersistentVector.kt index 5f9c92de..7072814c 100644 --- a/core/commonMain/src/implementations/immutableList/SmallPersistentVector.kt +++ b/core/commonMain/src/implementations/immutableList/SmallPersistentVector.kt @@ -5,14 +5,13 @@ package kotlinx.collections.immutable.implementations.immutableList -import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.PersistentList import kotlinx.collections.immutable.internal.ListImplementation.checkElementIndex import kotlinx.collections.immutable.internal.ListImplementation.checkPositionIndex import kotlinx.collections.immutable.internal.assert import kotlinx.collections.immutable.mutate -internal class SmallPersistentVector(private val buffer: Array) : ImmutableList, AbstractPersistentList() { +internal class SmallPersistentVector(private val buffer: Array) : AbstractPersistentList() { init { assert(buffer.size <= MAX_BUFFER_SIZE) @@ -162,4 +161,4 @@ internal class SmallPersistentVector(private val buffer: Array) : Immut companion object { val EMPTY = SmallPersistentVector(emptyArray()) } -} \ No newline at end of file +}