fixup! fix(gears: matcher: default_matcher): handle sidecase of string.match-ing the empty string ('')

style: return true/false instead of assigning nil to result
This commit is contained in:
actionless 2020-04-22 01:52:41 +02:00
parent fa494a1e18
commit f803347fc8
1 changed files with 2 additions and 2 deletions

View File

@ -80,10 +80,10 @@ local matcher = {}
local function default_matcher(a, b)
local result = a == b
if result then return result end
if result then return true end
if type(a) == "string" and type(b) == "string" then
result = a:match(b)
if result == '' then result = nil end
if result == '' then return false end
end
return result
end