diff mod_bookmarks2/mod_bookmarks2.lua @ 3738:9cd6d602ad1b

mod_bookmarks2: Simplify for loop (thanks MattJ!).
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Wed, 13 Nov 2019 15:51:59 +0100
parents 310061f6e1df
children 1ed3d86eeaed
line wrap: on
line diff
--- a/mod_bookmarks2/mod_bookmarks2.lua	Mon Nov 04 18:12:21 2019 +0100
+++ b/mod_bookmarks2/mod_bookmarks2.lua	Wed Nov 13 15:51:59 2019 +0100
@@ -55,8 +55,8 @@
 	end
 
 	local storage = st.stanza("storage", { xmlns = "storage:bookmarks" });
-	for i in ipairs(ret) do
-		local item = ret[ret[i]];
+	for _, item_id in ipairs(ret) do
+		local item = ret[item_id];
 		local conference = st.stanza("conference");
 		conference.attr.jid = item.attr.id;
 		local bookmark = item:get_child("conference", "urn:xmpp:bookmarks:0");