Software /
code /
prosody
Diff
util/pubsub.lua @ 6436:31ca87ea8d46
util.pubsub: One less table allocated per pubsub object created
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 28 Sep 2014 00:05:21 +0200 |
parent | 6435:689cb04ff9fd |
child | 6437:3f1f11dfdf10 |
line wrap: on
line diff
--- 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 = {};