summaryrefslogtreecommitdiff
path: root/lualibs-set.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <megas.kapaneus@gmail.com>2012-10-19 18:37:00 +0200
committerPhilipp Gesang <megas.kapaneus@gmail.com>2012-10-19 18:37:00 +0200
commit42d2142a79697299cf42b60d63d8c025d942df36 (patch)
treefc72d63786b6a164eff45afbbb093f172b12cb6a /lualibs-set.lua
parente84a0c500a2104dc82b8278d7778144351aa71b3 (diff)
downloadlualibs-42d2142a79697299cf42b60d63d8c025d942df36.tar.gz
update lualibs-set.lua
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," ")