mod_http_muc_log: Move scope of variables into loop

Wed, 01 Mar 2017 20:31:08 +0100

author
Kim Alvefur <zash@zash.se>
date
Wed, 01 Mar 2017 20:31:08 +0100
changeset 2591
3e1a85c5194c
parent 2590
63dd3e525f13
child 2592
fb1987d4ac62

mod_http_muc_log: Move scope of variables into loop

mod_http_muc_log/mod_http_muc_log.lua file | annotate | diff | comparison | revisions
--- a/mod_http_muc_log/mod_http_muc_log.lua	Wed Mar 01 20:29:40 2017 +0100
+++ b/mod_http_muc_log/mod_http_muc_log.lua	Wed Mar 01 20:31:08 2017 +0100
@@ -184,11 +184,10 @@
 	end
 
 	local first, last;
-	local verb, subject, body;
 	for key, item, when in iter do
-		body = item:get_child_text("body");
-		subject = item:get_child_text("subject");
-		verb = nil;
+		local body = item:get_child_text("body");
+		local subject = item:get_child_text("subject");
+		local verb = nil;
 		if subject then
 			verb, body = "set the topic to", subject;
 		elseif body and body:sub(1,4) == "/me " then

mercurial