style(util): rename tablelength to tableSize

This commit is contained in:
Qingping Hou
2016-01-28 22:37:46 -08:00
parent fab1f9572f
commit e19f73bdba
3 changed files with 6 additions and 5 deletions

View File

@@ -46,7 +46,7 @@ function util.gsplit(str, pattern, capture)
end)
end
--https://gist.github.com/jesseadams/791673
-- https://gist.github.com/jesseadams/791673
function util.secondsToClock(seconds, withoutSeconds)
seconds = tonumber(seconds)
if seconds == 0 or seconds ~= seconds then
@@ -66,7 +66,8 @@ function util.secondsToClock(seconds, withoutSeconds)
end
end
function util.tablelength(T)
-- returns number of keys in a table
function util.tableSize(T)
local count = 0
for _ in pairs(T) do count = count + 1 end
return count