From 75c6755d326097eb5b725dee46e7fb6377b01c88 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 1 Feb 2018 16:40:06 -0800 Subject: [PATCH] Switched accumulate() to return a table, not a string. --- utils.lua | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/utils.lua b/utils.lua index 937252f..6b802d2 100644 --- a/utils.lua +++ b/utils.lua @@ -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)