big refactoring
This commit is contained in:
+4
-3
@@ -1,6 +1,6 @@
|
||||
aux.module 'util'
|
||||
|
||||
local temp, getn = g.aux.temp, g.getn
|
||||
local temp, recycle, getn = temp, recycle, g.getn
|
||||
|
||||
function public.copy(t)
|
||||
local copy = {}
|
||||
@@ -205,9 +205,10 @@ end
|
||||
|
||||
do
|
||||
local mt = {__call = function(self, key) return self[key] end}
|
||||
function public.hashset(...) -- TODO rename/remove?
|
||||
function public.set(t)
|
||||
local self = {}
|
||||
for i=1,arg.n do self[arg[i]] = true end
|
||||
for i=1,getn(t) do self[t[i]] = true end
|
||||
recycle(t)
|
||||
return setmetatable(self, mt)
|
||||
end
|
||||
end
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ end
|
||||
|
||||
--function public.to_string(params) -- TODO
|
||||
-- local gold, silver, copper = to_gsc(params.copper or 0 + )
|
||||
-- local settings = hashset(unpack(arg))
|
||||
-- local settings = set(unpack(arg))
|
||||
--end
|
||||
|
||||
function public.to_string(money, pad, trim, decimal_points, color, no_color)
|
||||
|
||||
Reference in New Issue
Block a user