mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
migration to ByteArray + small fix
This commit is contained in:
parent
c668cdafd1
commit
657069cd48
1 changed files with 3 additions and 3 deletions
|
|
@ -33,7 +33,7 @@ local data_buffer =
|
|||
function data_buffer:new(bytes)
|
||||
local obj = {
|
||||
pos = 1,
|
||||
bytes = bytes or { }
|
||||
bytes = Bytearray(bytes or { })
|
||||
}
|
||||
|
||||
self.__index = self
|
||||
|
|
@ -49,7 +49,7 @@ function data_buffer:put_byte(byte)
|
|||
error("invalid byte")
|
||||
end
|
||||
|
||||
self.bytes[self.pos] = byte
|
||||
self.bytes:insert(self.pos, byte)
|
||||
|
||||
self.pos = self.pos + 1
|
||||
end
|
||||
|
|
@ -247,4 +247,4 @@ end
|
|||
|
||||
setmetatable(data_buffer, data_buffer)
|
||||
|
||||
return data_buffer
|
||||
return data_buffer
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue