Implement optimized removeRange for ArrayDeque #KT-64956

Test ArrayDeque with size 15. With the existing sizes the removeRange
implementation couldn't reach the maximum number of iterations - 3.

Benchmark results for ArrayDeque.subList().clear() that uses
removeRange() can be found here:
https://github.com/qurbonzoda/KotlinArrayDequeBenchmarks/tree/master/results
This commit is contained in:
Abduqodiri Qurbonzoda
2024-01-30 16:01:14 +02:00
committed by Space Team
parent 240a423bed
commit b67ebf36a2
5 changed files with 128 additions and 7 deletions
@@ -10085,6 +10085,8 @@ public final class ArrayDeque<E> : kotlin.collections.AbstractMutableList<E> {
public final fun removeLastOrNull(): E?
protected open override fun removeRange(fromIndex: kotlin.Int, toIndex: kotlin.Int): kotlin.Unit
public open override fun retainAll(elements: kotlin.collections.Collection<E>): kotlin.Boolean
public open override operator fun set(index: kotlin.Int, element: E): E