From 3042fce50e461decc12b86dd381f24140a838648 Mon Sep 17 00:00:00 2001 From: sammyette <38820196+TorchedSammy@users.noreply.github.com> Date: Sun, 17 Oct 2021 18:10:06 -0400 Subject: [PATCH] fix: cleanup since returned tables from functions aren't userdata anymore --- preload.lua | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/preload.lua b/preload.lua index ae0810b..c803a5b 100644 --- a/preload.lua +++ b/preload.lua @@ -44,11 +44,7 @@ commander.register('doc', function(args) local globalDesc = [[ These are the global Hilbish functions that are always available and not part of a module.]] if #args > 0 then - local mod = '' - for i = 1, #args do - mod = mod .. tostring(args[i]) .. ' ' - end - mod = mod:gsub('^%s*(.-)%s*$', '%1') + local mod = table.concat(args, ' '):gsub('^%s*(.-)%s*$', '%1') local f = io.open(moddocPath .. mod .. '.txt', 'rb') if not f then @@ -83,11 +79,7 @@ Usage: doc Available modules: ]] - local mods = '' - for i = 1, #modules do - mods = mods .. tostring(modules[i]):gsub('.txt', '') .. ', ' - end - print(mods) + print(table.concat(modules, ', ')) return end)