Changeset

8501:8d9e2c2095dd

util.pubsub: Move service methods object creation (just code reorganisation)
author Matthew Wild <mwild1@gmail.com>
date Fri, 02 Feb 2018 19:29:17 +0000
parents 8500:9bf00d0734c8
children 8502:6c2c2fc4b8dd
files util/pubsub.lua
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/util/pubsub.lua	Thu Feb 01 15:09:04 2018 +0000
+++ b/util/pubsub.lua	Fri Feb 02 19:29:17 2018 +0000
@@ -1,8 +1,7 @@
 local events = require "util.events";
 local cache = require "util.cache";
 
-local service = {};
-local service_mt = { __index = service };
+local service_mt = {};
 
 local default_config = {
 	itemstore = function (config, _) return cache.new(config["max_items"]) end;
@@ -31,6 +30,11 @@
 	}, service_mt);
 end
 
+--- Service methods
+
+local service = {};
+service_mt.__index = service;
+
 function service:jids_equal(jid1, jid2)
 	local normalize = self.config.normalize_jid;
 	return normalize(jid1) == normalize(jid2);