Avoid recalculating operation names repeatedly.
This commit is contained in:
parent
f7170428c9
commit
d2b453395a
@ -12,11 +12,21 @@ function _update()
|
||||
function _draw()
|
||||
_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)
|
||||
for x2 in all(split"0,,2,3") do
|
||||
|
||||
for n in names(x) do
|
||||
for mod in all(modules) do
|
||||
local f=mod[x..x2]
|
||||
if (f != nil) f(mod)
|
||||
local f=mod[n]
|
||||
if (f) f(mod)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user