Add is_empty, preprend to standard lib / bytearray

This commit is contained in:
KtorZ 2022-11-10 17:32:50 +01:00 committed by Lucas
parent 9f374d9431
commit 98f90a572f
1 changed files with 8 additions and 0 deletions

View File

@ -8,6 +8,14 @@ pub fn length(bytes: ByteArray) -> Int {
builtin.lengthOfByteArray(bytes) builtin.lengthOfByteArray(bytes)
} }
pub fn is_empty(bytes: ByteArray) -> Bool {
builtin.emptyByteArray(bytes)
}
pub fn concat(left front: ByteArray, right back: ByteArray) -> ByteArray { pub fn concat(left front: ByteArray, right back: ByteArray) -> ByteArray {
builtin.appendByteArray(front, back) builtin.appendByteArray(front, back)
} }
pub fn prepend(rest: ByteArray, byte: Int) -> ByteArray {
builtin.consByteArray(byte, rest)
}