mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 04:21:50 +00:00
feat: ipairs(...) support in Bytearray
This commit is contained in:
parent
d8feff56c0
commit
9169049530
2 changed files with 13 additions and 0 deletions
|
|
@ -119,6 +119,15 @@ local bytearray_mt = {
|
|||
end,
|
||||
__gc = function(self)
|
||||
free(self.bytes)
|
||||
end,
|
||||
__ipairs = function(self)
|
||||
local i = 0
|
||||
return function()
|
||||
i = i + 1
|
||||
if i <= self.size then
|
||||
return i, self.bytes[i - 1]
|
||||
end
|
||||
end
|
||||
end
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue