From 19087a7303f5eb41a70ca421975acba640386f21 Mon Sep 17 00:00:00 2001 From: Kenny Shields Date: Mon, 27 Jan 2014 07:42:18 -0500 Subject: [PATCH] Optimize loveframes.util.TableHasKey --- libraries/util.lua | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/libraries/util.lua b/libraries/util.lua index 16622e5..6117f54 100644 --- a/libraries/util.lua +++ b/libraries/util.lua @@ -276,13 +276,7 @@ end --]]--------------------------------------------------------- function loveframes.util.TableHasKey(table, key) - for k, v in pairs(table) do - if k == key then - return true - end - end - - return false + return table[key] ~= nil end