STDLIB: boolean array routines: copyRangeTo
This commit is contained in:
committed by
vvlevchenko
parent
c395bc80a0
commit
dce92af744
@@ -276,6 +276,10 @@ void Kotlin_DoubleArray_copyImpl(KConstRef thiz, KInt fromIndex,
|
|||||||
copyImpl<KDouble>(thiz, fromIndex, destination, toIndex, count);
|
copyImpl<KDouble>(thiz, fromIndex, destination, toIndex, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Kotlin_BooleanArray_copyImpl(KConstRef thiz, KInt fromIndex,
|
||||||
|
KRef destination, KInt toIndex, KInt count) {
|
||||||
|
copyImpl<KBoolean>(thiz, fromIndex, destination, toIndex, count);
|
||||||
|
}
|
||||||
|
|
||||||
KLong Kotlin_LongArray_get(KConstRef thiz, KInt index) {
|
KLong Kotlin_LongArray_get(KConstRef thiz, KInt index) {
|
||||||
const ArrayHeader* array = thiz->array();
|
const ArrayHeader* array = thiz->array();
|
||||||
|
|||||||
@@ -89,6 +89,9 @@ external private fun copyImpl(array: FloatArray, fromIndex: Int,
|
|||||||
external private fun copyImpl(array: DoubleArray, fromIndex: Int,
|
external private fun copyImpl(array: DoubleArray, fromIndex: Int,
|
||||||
destination: DoubleArray, toIndex: Int, count: Int)
|
destination: DoubleArray, toIndex: Int, count: Int)
|
||||||
|
|
||||||
|
@SymbolName("Kotlin_BooleanArray_copyImpl")
|
||||||
|
external private fun copyImpl(array: BooleanArray, fromIndex: Int,
|
||||||
|
destination: BooleanArray, toIndex: Int, count: Int)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copies a range of array elements at a specified [fromIndex] (inclusive) to [toIndex] (exclusive) range of indices
|
* Copies a range of array elements at a specified [fromIndex] (inclusive) to [toIndex] (exclusive) range of indices
|
||||||
@@ -127,6 +130,10 @@ fun FloatArray.copyRangeTo(destination: FloatArray, fromIndex: Int, toIndex: Int
|
|||||||
fun DoubleArray.copyRangeTo(destination: DoubleArray, fromIndex: Int, toIndex: Int, destinationIndex: Int = 0) {
|
fun DoubleArray.copyRangeTo(destination: DoubleArray, fromIndex: Int, toIndex: Int, destinationIndex: Int = 0) {
|
||||||
copyImpl(this, fromIndex, destination, destinationIndex, toIndex - fromIndex)
|
copyImpl(this, fromIndex, destination, destinationIndex, toIndex - fromIndex)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun BooleanArray.copyRangeTo(destination: BooleanArray, fromIndex: Int, toIndex: Int, destinationIndex: Int = 0) {
|
||||||
|
copyImpl(this, fromIndex, destination, destinationIndex, toIndex - fromIndex)
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Copies a range of array elements at a specified [fromIndex] (inclusive) to [toIndex] (exclusive) range of indices
|
* Copies a range of array elements at a specified [fromIndex] (inclusive) to [toIndex] (exclusive) range of indices
|
||||||
* to another part of this array starting at [destinationIndex].
|
* to another part of this array starting at [destinationIndex].
|
||||||
|
|||||||
Reference in New Issue
Block a user