mirror of
https://github.com/linux-man/LoveFrames.git
synced 2024-11-26 05:14:21 +00:00
Optimize loveframes.util.TableHasKey
This commit is contained in:
parent
838ac1c85c
commit
19087a7303
@ -276,13 +276,7 @@ end
|
|||||||
--]]---------------------------------------------------------
|
--]]---------------------------------------------------------
|
||||||
function loveframes.util.TableHasKey(table, key)
|
function loveframes.util.TableHasKey(table, key)
|
||||||
|
|
||||||
for k, v in pairs(table) do
|
return table[key] ~= nil
|
||||||
if k == key then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return false
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user