refactoring

This commit is contained in:
Manuel Simon Hirsig
2016-08-31 01:28:44 +02:00
parent 00a1e7a897
commit adb595ba8d
+12 -12
View File
@@ -11,10 +11,10 @@ CreateFrame('Frame'):SetScript('OnUpdate', function()
wipe(tmp) wipe(tmp)
end) end)
--do do
-- local t = setmetatable({}, {__metatable=false, newindex=error}) local t = setmetatable({}, {__metatable=false, __newindex=error})
-- public.O.get = t public.O.get = t
--end end
function wipe(t) -- like with a cloth or something function wipe(t) -- like with a cloth or something
for k in t do t[k] = nil end for k in t do t[k] = nil end
@@ -78,18 +78,18 @@ do
do do
local mt = mt(function(t) tmp[t] = true; return t end) local mt = mt(function(t) tmp[t] = true; return t end)
public.temp public.temp
{ {
get = function() return setmetatable(table(), mt) end, get = function() return setmetatable(table(), mt) end,
set = function(t) tmp[t] = true end, set = function(t) tmp[t] = true end,
} }
end end
do do
local mt = mt(function(t) tmp[t] = nil; return t end) local mt = mt(function(t) tmp[t] = nil; return t end)
public.perm public.perm
{ {
get = function() return setmetatable(table(), mt) end, get = function() return setmetatable(table(), mt) end,
set = function(t) tmp[t] = nil end, set = function(t) tmp[t] = nil end,
} }
end end
end end
do do