summaryrefslogtreecommitdiff
path: root/lualibs-set.lua
diff options
context:
space:
mode:
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," ")