mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-10 05:21:49 +00:00
add Bytearray '__pairs` metamethod
This commit is contained in:
parent
50aae8b98b
commit
805e3fdd7d
2 changed files with 3 additions and 2 deletions
|
|
@ -166,11 +166,12 @@ local bytearray_mt = {
|
|||
end
|
||||
end
|
||||
}
|
||||
bytearray_mt.__pairs = bytearray_mt.__ipairs
|
||||
|
||||
local bytearray_type = FFI.metatype("bytearray_t", bytearray_mt)
|
||||
|
||||
local FFIBytearray = {
|
||||
__call = function (n)
|
||||
__call = function (self, n)
|
||||
local t = type(n)
|
||||
if t == "string" then
|
||||
local buffer = malloc(#n)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue