diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-02-01 16:40:06 -0800 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-02-01 16:40:26 -0800 |
| commit | 75c6755d326097eb5b725dee46e7fb6377b01c88 (patch) | |
| tree | 808d8b5394da19e348f4605469f4d46bcc7cf0e6 /utils.lua | |
| parent | f1d4a568a3aa15f3c25524a848c0cc597d175d6e (diff) | |
Switched accumulate() to return a table, not a string.
Diffstat (limited to 'utils.lua')
| -rw-r--r-- | utils.lua | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -127,15 +127,12 @@ local function remove_from_list(list, item) for i=N-deleted+1,N do list[i] = nil end end -local function accumulate(glue, co) - if co == nil then - glue, co = "", glue - end - local bits = { } +local function accumulate(co) + local bits = {} for bit in coroutine.wrap(co) do bits[#bits+1] = bit end - return table.concat(bits, glue) + return bits end local function nth_to_last(list, n) |
