forked from pyrex/chameleonic
Avoid recalculating operation names repeatedly. (#1) #2
@ -12,11 +12,21 @@ function _update()
|
|||||||
function _draw()
|
function _draw()
|
||||||
_doall("draw") end
|
_doall("draw") end
|
||||||
|
|
||||||
|
mnames={}
|
||||||
|
function names(root)
|
||||||
|
local n=mnames[root]
|
||||||
|
if(n)return all(n)
|
||||||
|
n={root.."0", root, root.."2", root.."3"}
|
||||||
|
mnames[root]=n
|
||||||
|
return all(n)
|
||||||
|
end
|
||||||
|
|
||||||
function _doall(x)
|
function _doall(x)
|
||||||
for x2 in all(split"0,,2,3") do
|
|
||||||
|
for n in names(x) do
|
||||||
for mod in all(modules) do
|
for mod in all(modules) do
|
||||||
local f=mod[x..x2]
|
local f=mod[n]
|
||||||
if (f != nil) f(mod)
|
if (f) f(mod)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user