fix padEnd
This commit is contained in:
@@ -52,10 +52,10 @@ fun ByteArray.padEnd(
|
|||||||
padByte: Byte,
|
padByte: Byte,
|
||||||
): ByteArray {
|
): ByteArray {
|
||||||
return buildList {
|
return buildList {
|
||||||
|
addAll(this)
|
||||||
repeat(length - size) {
|
repeat(length - size) {
|
||||||
add(padByte)
|
add(padByte)
|
||||||
}
|
}
|
||||||
addAll(this)
|
|
||||||
}.toByteArray()
|
}.toByteArray()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,10 +49,10 @@ fun UByteArray.padEnd(
|
|||||||
padByte: UByte,
|
padByte: UByte,
|
||||||
): UByteArray {
|
): UByteArray {
|
||||||
return buildList {
|
return buildList {
|
||||||
|
addAll(this)
|
||||||
repeat(length - size) {
|
repeat(length - size) {
|
||||||
add(padByte)
|
add(padByte)
|
||||||
}
|
}
|
||||||
addAll(this)
|
|
||||||
}.toUByteArray()
|
}.toUByteArray()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user