Avoid recalculating operation names repeatedly. (#1)
Reviewed-on: #1 Co-authored-by: Kistaro Windrider <kistaro@gmail.com> Co-committed-by: Kistaro Windrider <kistaro@gmail.com>
This commit is contained in:
parent
f7170428c9
commit
517c185688
@ -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