From 067e58b30f37ddaf1baeeb4b65950b94986aa29d Mon Sep 17 00:00:00 2001 From: rxi Date: Sat, 10 Jan 2015 14:31:55 +0000 Subject: [PATCH] Changed lume.count() to return length if table is array --- lume.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lume.lua b/lume.lua index 625393f..ed16bb9 100644 --- a/lume.lua +++ b/lume.lua @@ -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