mirror of
https://github.com/kikito/inspect.lua.git
synced 2024-12-15 14:34:21 +00:00
just use # for Lua 5.1
This commit is contained in:
parent
6c1a22c207
commit
3392fa6314
11
inspect.lua
11
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
|
||||
|
Loading…
Reference in New Issue
Block a user