# HG changeset patch # User Emmanuel Gil Peyrot # Date 1573656719 -3600 # Node ID 9cd6d602ad1bd2c81b0e5e0cd77ca1639e0227d1 # Parent 49e65a7e94158053266d2924d8db96e92ea6862b mod_bookmarks2: Simplify for loop (thanks MattJ!). diff -r 49e65a7e9415 -r 9cd6d602ad1b mod_bookmarks2/mod_bookmarks2.lua --- 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");