mirror of
https://github.com/kepler155c/opus
synced 2024-11-15 05:04:50 +00:00
7224d441ca
* canvas overhaul * minor tweaks * list mode for overview * bugfixes + tweaks for editor 2.0 * minor tweaks * more editor work * refactor + new transitions * use layout() where appropriate and cleanup * mouse triple click + textEntry scroll ind * cleanup * cleanup + theme editor * color rework + cleanup * changes for deprecated ui methods * can now use named colors
27 lines
352 B
Lua
27 lines
352 B
Lua
local Util = require('opus.util')
|
|
|
|
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
|
|
|
|
Array.find = Util.find
|
|
|
|
return Array
|