diff options
author | Philipp Gesang <phg42.2a@gmail.com> | 2013-04-29 15:00:05 -0700 |
---|---|---|
committer | Philipp Gesang <phg42.2a@gmail.com> | 2013-04-29 15:00:05 -0700 |
commit | 5ff06a36a0e82f3350bc955fac3825d7a1969289 (patch) | |
tree | d02c81d72c38393699bba1cc0ac6152f58aa44a6 /lualibs-set.lua | |
parent | 69adb7e51c6c082d0e16e45ff9f5ac75c4618056 (diff) | |
parent | 170fbd1a07aaadace4b976f62e67572c53c8449b (diff) | |
download | lualibs-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.lua | 7 |
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," ") |