refactoring

This commit is contained in:
Manuel Simon Hirsig
2016-07-31 15:14:55 +02:00
parent be200921ef
commit a0e0728298
6 changed files with 82 additions and 52 deletions
+9 -3
View File
@@ -3,8 +3,14 @@ local m, public, private = Aux.module'util'
function public.pass()
end
function public.id(object)
return object
function public.id(value)
return value
end
function public.const(value)
return function()
return value
end
end
function public.size(table)
@@ -147,7 +153,7 @@ end
function public.filter(xs, p)
local ys = {}
for _, x in ipairs(xs) do
for _, x in xs do
if p(x) then
tinsert(ys, x)
end
+1 -1
View File
@@ -718,7 +718,7 @@ function public.validator(blizzard_filter, post_filter)
return function(record)
if blizzard_filter.exact and strlower(Aux.info.item(record.item_id).name) ~= blizzard_filter.name then
return
return false
end
if getn(post_filter) > 0 then
local stack = {}