mirror of
https://github.com/kepler155c/opus
synced 2025-12-17 05:38:07 +00:00
array api
This commit is contained in:
13
sys/apis/array.lua
Normal file
13
sys/apis/array.lua
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
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
|
||||||
|
|
||||||
|
return Array
|
||||||
Reference in New Issue
Block a user