From 3392fa6314dff8568327936ab0455b15ca1c95eb Mon Sep 17 00:00:00 2001 From: nymphium Date: Fri, 20 Nov 2015 23:51:44 +0900 Subject: [PATCH] just use # for Lua 5.1 --- inspect.lua | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/inspect.lua b/inspect.lua index fce3f48..d6c159a 100644 --- a/inspect.lua +++ b/inspect.lua @@ -32,16 +32,7 @@ inspect.KEY = setmetatable({}, {__tostring = function() return 'inspect.KE inspect.METATABLE = setmetatable({}, {__tostring = function() return 'inspect.METATABLE' end}) local rawlen = rawlen or function(t) - local _M, len = getmetatable(t) - if _M then - setmetatable(t, {}) - len = #t - setmetatable(t, _M) - else - len = #t - end - - return len + return #t end -- Apostrophizes the string if it has quotes, but not aphostrophes