big refactoring

This commit is contained in:
Manuel Simon Hirsig
2016-08-21 21:41:28 +02:00
parent c235f0332e
commit 7232d62418
9 changed files with 30 additions and 32 deletions
+3 -3
View File
@@ -15,7 +15,7 @@ do
-- log(getn(table_pool))
end
public.temp = setmetatable({}, {__sub = function(_, t) auto_recycle[t] = true return t end})
function public.t.get() return tremove(table_pool) or {} end
function public.getter.t() 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
@@ -40,8 +40,8 @@ end
ADDON_LOADED = {}
do
local variables_loaded_hooks, player_login_hooks = t, t
function public.LOAD.set(f) tinsert(variables_loaded_hooks, f) end
function public.LOAD2.set(f) tinsert(player_login_hooks, f) end
function public.setter.LOAD(f) tinsert(variables_loaded_hooks, f) end
function public.setter.LOAD2(f) tinsert(player_login_hooks, f) end
event_frame:SetScript('OnEvent', function()
if event == 'ADDON_LOADED' then
if ADDON_LOADED[arg1] then ADDON_LOADED[arg1]() end