From 00a1e7a897b0bbb505f4524ba9ae71c6d1fbf7d7 Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Wed, 31 Aug 2016 01:26:59 +0200 Subject: [PATCH] bugfix --- libs/green_t.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/green_t.lua b/libs/green_t.lua index a244f23..5b944b9 100644 --- a/libs/green_t.lua +++ b/libs/green_t.lua @@ -68,15 +68,15 @@ function public.tt.get() end do - local function modifier_mt(f) + local function mt(f) local function apply(self, value) recycle(self) - return f(value) + return type(value) == 'table' and f(value) or value end return {__call=apply, __sub=apply} end do - local mt = modifier_mt(function(t) tmp[t] = true; return t end) + local mt = mt(function(t) tmp[t] = true; return t end) public.temp { get = function() return setmetatable(table(), mt) end, @@ -84,7 +84,7 @@ do } end do - local mt = modifier_mt(function(t) tmp[t] = nil; return t end) + local mt = mt(function(t) tmp[t] = nil; return t end) public.perm { get = function() return setmetatable(table(), mt) end,