From 2d58001a25c924d5e77e568c9984981443aee5ad Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 28 Sep 2014 00:05:21 +0200 Subject: util.pubsub: One less table allocated per pubsub object created --- util/pubsub.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/pubsub.lua b/util/pubsub.lua index afab634a..3c67be90 100644 --- a/util/pubsub.lua +++ b/util/pubsub.lua @@ -6,16 +6,16 @@ module("pubsub", package.seeall); local service = {}; local service_mt = { __index = service }; -local default_config = { +local default_config = { __index = { broadcaster = function () end; get_affiliation = function () end; capabilities = {}; -}; +} }; function new(config) config = config or {}; return setmetatable({ - config = setmetatable(config, { __index = default_config }); + config = setmetatable(config, default_config); affiliations = {}; subscriptions = {}; nodes = {}; -- cgit v1.2.3