mirror of
https://github.com/kikito/middleclass.git
synced 2024-11-25 02:44:20 +00:00
eliminates innecessary metatable setting
This commit is contained in:
parent
958cae6c1c
commit
3527b5cab9
@ -79,10 +79,9 @@ local function _createClass(name, super)
|
|||||||
subclasses = setmetatable({}, {__mode='k'}) }
|
subclasses = setmetatable({}, {__mode='k'}) }
|
||||||
|
|
||||||
if super then
|
if super then
|
||||||
setmetatable(dict, { __index = super.__instanceDict })
|
|
||||||
setmetatable(aClass.static, { __index = function(_,k) return rawget(dict,k) or super.static[k] end })
|
setmetatable(aClass.static, { __index = function(_,k) return rawget(dict,k) or super.static[k] end })
|
||||||
else
|
else
|
||||||
setmetatable(aClass.static, { __index = function(_,k) return dict[k] end })
|
setmetatable(aClass.static, { __index = function(_,k) return rawget(dict,k) end })
|
||||||
end
|
end
|
||||||
|
|
||||||
setmetatable(aClass, { __index = aClass.static, __tostring = _tostring,
|
setmetatable(aClass, { __index = aClass.static, __tostring = _tostring,
|
||||||
|
Loading…
Reference in New Issue
Block a user