From 18db3dbf89bce215dd513e696b1557beed40c8d2 Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Tue, 6 Sep 2016 22:06:36 +0200 Subject: [PATCH] refactoring --- aux-addon.lua | 1 - libs/green_t.lua | 2 +- util/core.lua | 6 +++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/aux-addon.lua b/aux-addon.lua index fe10560..eb16ce9 100644 --- a/aux-addon.lua +++ b/aux-addon.lua @@ -67,7 +67,6 @@ do function env.private.USE_ITEM.set(f) tab.USE_ITEM = f end function env.private.CLICK_LINK.set(f) tab.CLICK_LINK = f end function env.public.ACTIVE.get() return tab == active_tab end - p(tab) tinsert(tab_info, tab) end end diff --git a/libs/green_t.lua b/libs/green_t.lua index 4f97263..4715d2d 100644 --- a/libs/green_t.lua +++ b/libs/green_t.lua @@ -113,7 +113,7 @@ do code = code .. [[ overflow) if overflow ~= nil then error("Vararg overflow.") end - local n + local n = 0 repeat ]] for i = MAXPARAMS - 1, 1, -1 do diff --git a/util/core.lua b/util/core.lua index 36d72b8..1d54126 100644 --- a/util/core.lua +++ b/util/core.lua @@ -48,7 +48,11 @@ public.select = vararg(function(arg) for _ = 1, arg[1] do tremove(arg, 1) end - return unpack(arg) + if getn(arg) == 0 then + return nil + else + return unpack(arg) + end end) public.join = _G.table.concat