1
0
mirror of https://github.com/kepler155c/opus synced 2024-06-21 04:40:00 +00:00
opus/sys/modules/opus/array.lua
kepler155c@gmail.com 5a874c1944 canvas overhaul
2020-03-31 09:57:23 -06:00

23 lines
293 B
Lua

local Array = { }
function Array.filter(it, f)
local ot = { }
for _,v in pairs(it) do
if f(v) then
table.insert(ot, v)
end
end
return ot
end
function Array.removeByValue(t, e)
for k,v in pairs(t) do
if v == e then
table.remove(t, k)
return e
end
end
end
return Array