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:
parent
fa494a1e18
commit
f803347fc8
|
@ -80,10 +80,10 @@ local matcher = {}
|
||||||
|
|
||||||
local function default_matcher(a, b)
|
local function default_matcher(a, b)
|
||||||
local result = 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
|
if type(a) == "string" and type(b) == "string" then
|
||||||
result = a:match(b)
|
result = a:match(b)
|
||||||
if result == '' then result = nil end
|
if result == '' then return false end
|
||||||
end
|
end
|
||||||
return result
|
return result
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue