Changed lume.count() to return length if table is array

This commit is contained in:
rxi 2015-01-10 14:31:55 +00:00
parent a42cbb12f0
commit 067e58b30f

View File

@ -265,6 +265,9 @@ function lume.count(t, fn)
if fn(v) then count = count + 1 end
end
else
if isarray(t) then
return #t
end
for k in iter(t) do count = count + 1 end
end
return count