# HG changeset patch # User Kim Alvefur # Date 1411855521 -7200 # Node ID 31ca87ea8d46699a13ffe86d8cac273d58010a94 # Parent 689cb04ff9fdff8849c4364419c7e5da6c58fdbe util.pubsub: One less table allocated per pubsub object created diff -r 689cb04ff9fd -r 31ca87ea8d46 util/pubsub.lua --- a/util/pubsub.lua Sat Sep 27 19:57:33 2014 +0200 +++ b/util/pubsub.lua Sun Sep 28 00:05:21 2014 +0200 @@ -6,16 +6,16 @@ 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 = {};