Remove workaround for complex default value in Array.copyInto

#KT-22818
This commit is contained in:
Ilya Gorbunov
2018-09-20 04:06:57 +03:00
parent a5f1ed9a5d
commit 974837654e
6 changed files with 15 additions and 38 deletions
@@ -130,8 +130,6 @@ internal actual fun <T> arrayOfNulls(reference: Array<T>, size: Int): Array<T> {
@PublishedApi
@JsName("arrayCopy")
internal fun <T> arrayCopy(source: Array<out T>, destination: Array<in T>, destinationOffset: Int, startIndex: Int, endIndex: Int) {
@Suppress("NAME_SHADOWING")
val endIndex = if (endIndex == -1) source.size else endIndex // TODO: Remove when default value from expect is fixed
AbstractList.checkRangeIndexes(startIndex, endIndex, source.size)
val rangeSize = endIndex - startIndex
AbstractList.checkRangeIndexes(destinationOffset, destinationOffset + rangeSize, destination.size)