big refactoring

This commit is contained in:
Manuel Simon Hirsig
2016-08-21 18:41:09 +02:00
parent 0fd05a0ba8
commit 29f76b7659
2 changed files with 11 additions and 28 deletions
+3 -6
View File
@@ -7,8 +7,7 @@ do
local table_pool, auto_recycle = {}, {}
local function wipe(t) -- like with a cloth or something
for k in t do t[k] = nil end
setn(t, 0)
return t
setn(t, 0); return t
end
function public.recycle(t)
auto_recycle[t] = nil
@@ -19,8 +18,7 @@ do
function public.t.get() return tremove(table_pool) or {} end
CreateFrame('Frame'):SetScript('OnUpdate', function()
for t in auto_recycle do recycle(t) end
recycle(auto_recycle)
auto_recycle = t
recycle(auto_recycle); auto_recycle = t
end)
end
@@ -30,8 +28,7 @@ do
function public.module(name)
local env = module_env(name)
if not modules[name] then env.import(temp-{['']='modules', ['']='core', ['']='util'}) end
setfenv(2, env)
modules[name] = true
setfenv(2, env); modules[name] = true
end
end