diff options
Diffstat (limited to 'lib/gitano/lace.lua')
-rw-r--r-- | lib/gitano/lace.lua | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/lib/gitano/lace.lua b/lib/gitano/lace.lua index 97ed91b..25183ed 100644 --- a/lib/gitano/lace.lua +++ b/lib/gitano/lace.lua @@ -86,19 +86,14 @@ local function _do_simple_match(ctx, key, matchtype, value) if type(kk) == "string" then return check(value, kk) else - if pat and kk[1] ~= nil then - for i = 1, #kk do - if check(value, kk[i]) then - return true - end - end - return false - else - if matchtype:sub(1,1) == "!" then - return kk[value] == nil - end - return kk[value] ~= nil + local ret = false + for k in pairs(kk) do + ret = ret or check(value, k) + end + if matchtype:sub(1,1) == "!" then + ret = not ret end + return ret end end |