Move ArrayDeque.newCapacity to AbstractList

This commit is contained in:
Abduqodiri Qurbonzoda
2023-05-30 21:54:19 +03:00
committed by Space Team
parent d8cfc79d92
commit 2ef50f8c34
6 changed files with 67 additions and 53 deletions
@@ -183,7 +183,7 @@ internal class ListBuilder<E> private constructor(
if (backing != null) throw IllegalStateException() // just in case somebody casts subList to ListBuilder
if (minCapacity < 0) throw OutOfMemoryError() // overflow
if (minCapacity > array.size) {
val newSize = ArrayDeque.newCapacity(array.size, minCapacity)
val newSize = AbstractList.newCapacity(array.size, minCapacity)
array = array.copyOfUninitializedElements(newSize)
}
}