From 3527b5cab9b507d6a586c500d356709444715a17 Mon Sep 17 00:00:00 2001 From: kikito Date: Thu, 31 Dec 2015 18:52:39 +0100 Subject: [PATCH] eliminates innecessary metatable setting --- middleclass.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/middleclass.lua b/middleclass.lua index 799b8d1..1c793e7 100644 --- a/middleclass.lua +++ b/middleclass.lua @@ -79,10 +79,9 @@ local function _createClass(name, super) subclasses = setmetatable({}, {__mode='k'}) } if super then - setmetatable(dict, { __index = super.__instanceDict }) setmetatable(aClass.static, { __index = function(_,k) return rawget(dict,k) or super.static[k] end }) else - setmetatable(aClass.static, { __index = function(_,k) return dict[k] end }) + setmetatable(aClass.static, { __index = function(_,k) return rawget(dict,k) end }) end setmetatable(aClass, { __index = aClass.static, __tostring = _tostring,