more optimizations, split ci
All checks were successful
/ test (pull_request) Successful in 6m14s

This commit is contained in:
2026-01-14 16:03:16 +01:00
parent 23b565ca0a
commit 947ef907a5
6 changed files with 160 additions and 110 deletions

View File

@@ -45,8 +45,27 @@ fun UIntArray.copyInto(
require(startIndex in 0..(size - length))
require(destinationOffset in 0..(destination.size - (length * 4)))
repeat(length) { i ->
this[startIndex + i].copyInto(destination, destinationOffset + (i * 4), order)
when (order) {
BIG_ENDIAN -> {
repeat(length) { i ->
val offset = destinationOffset + (i * 4)
val value = this[startIndex + i]
destination[offset] = (value shr 24).toUByte()
destination[offset + 1] = (value shr 16).toUByte()
destination[offset + 2] = (value shr 8).toUByte()
destination[offset + 3] = value.toUByte()
}
}
LITTLE_ENDIAN -> {
repeat(length) { i ->
val offset = destinationOffset + (i * 4)
val value = this[startIndex + i]
destination[offset] = value.toUByte()
destination[offset + 1] = (value shr 8).toUByte()
destination[offset + 2] = (value shr 16).toUByte()
destination[offset + 3] = (value shr 24).toUByte()
}
}
}
}