util.pubsub: Rename loop variable to avoid name clash [luacheck]
authorKim Alvefur <zash@zash.se>
Tue, 18 Oct 2016 15:29:23 +0200
changeset 7706 74e755674e0f
parent 7705 9385c367e920
child 7707 5022e6181193
child 7711 c420a38db5ef
util.pubsub: Rename loop variable to avoid name clash [luacheck]
util/pubsub.lua
--- a/util/pubsub.lua	Tue Oct 18 15:19:01 2016 +0200
+++ b/util/pubsub.lua	Tue Oct 18 15:29:23 2016 +0200
@@ -371,13 +371,13 @@
 	-- a get_subscription() call for each node.
 	local ret = {};
 	if subs then
-		for jid, subscribed_nodes in pairs(subs) do
+		for subscribed_jid, subscribed_nodes in pairs(subs) do
 			if node then -- Return only subscriptions to this node
 				if subscribed_nodes[node] then
 					ret[#ret+1] = {
 						node = node;
-						jid = jid;
-						subscription = node_obj.subscribers[jid];
+						jid = subscribed_jid;
+						subscription = node_obj.subscribers[subscribed_jid];
 					};
 				end
 			else -- Return subscriptions to all nodes
@@ -385,8 +385,8 @@
 				for subscribed_node in pairs(subscribed_nodes) do
 					ret[#ret+1] = {
 						node = subscribed_node;
-						jid = jid;
-						subscription = nodes[subscribed_node].subscribers[jid];
+						jid = subscribed_jid;
+						subscription = nodes[subscribed_node].subscribers[subscribed_jid];
 					};
 				end
 			end