summaryrefslogtreecommitdiff
path: root/lualibs-set.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2013-04-29 15:00:05 -0700
committerPhilipp Gesang <phg42.2a@gmail.com>2013-04-29 15:00:05 -0700
commit5ff06a36a0e82f3350bc955fac3825d7a1969289 (patch)
treed02c81d72c38393699bba1cc0ac6152f58aa44a6 /lualibs-set.lua
parent69adb7e51c6c082d0e16e45ff9f5ac75c4618056 (diff)
parent170fbd1a07aaadace4b976f62e67572c53c8449b (diff)
downloadlualibs-5ff06a36a0e82f3350bc955fac3825d7a1969289.tar.gz
Merge pull request #1 from phi-gamma/master
import current status
Diffstat (limited to 'lualibs-set.lua')
-rw-r--r--lualibs-set.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/lualibs-set.lua b/lualibs-set.lua
index f844d0b..2370f01 100644
--- a/lualibs-set.lua
+++ b/lualibs-set.lua
@@ -6,6 +6,8 @@ if not modules then modules = { } end modules ['l-set'] = {
license = "see context related readme files"
}
+-- This will become obsolete when we have the bitset library embedded.
+
set = set or { }
local nums = { }
@@ -49,10 +51,11 @@ function set.tolist(n)
if n == 0 or not tabs[n] then
return ""
else
- local t = { }
+ local t, n = { }, 0
for k, v in next, tabs[n] do
if v then
- t[#t+1] = k
+ n = n + 1
+ t[n] = k
end
end
return concat(t," ")