# HG changeset patch # User Anton Shestakov # Date 1470979876 -28800 # Node ID e4f9c192b797bb8da2226f7ee120494416301807 # Parent 2ef93ba18336c99259dbd127204059bce73d35e7 ejabberdsql2prosody: remove unused one-letter loop variables [luacheck] diff -r 2ef93ba18336 -r e4f9c192b797 tools/ejabberdsql2prosody.lua --- a/tools/ejabberdsql2prosody.lua Fri Aug 12 13:29:27 2016 +0800 +++ b/tools/ejabberdsql2prosody.lua Fri Aug 12 13:31:16 2016 +0800 @@ -215,7 +215,7 @@ end --print(serialize(t)); -for i, row in ipairs(t["users"] or NULL) do +for _, row in ipairs(t["users"] or NULL) do local node, password = row.username, row.password; local ret, err = dm.store(node, host, "accounts", {password = password}); print("["..(err or "success").."] accounts: "..node.."@"..host); @@ -254,7 +254,7 @@ local ret, err = dm.list_append(node, host, "offline", st.preserialize(stanza)); print("["..(err or "success").."] offline: " ..node.."@"..host.." - "..os.date("!%Y-%m-%dT%H:%M:%SZ", t)); end -for i, row in ipairs(t["rosterusers"] or NULL) do +for _, row in ipairs(t["rosterusers"] or NULL) do local node, contact = row.username, row.jid; local name = row.nick; if name == "" then name = nil; end @@ -283,10 +283,10 @@ local item = {name = name, ask = ask, subscription = subscription, groups = {}}; roster(node, host, contact, item); end -for i, row in ipairs(t["rostergroups"] or NULL) do +for _, row in ipairs(t["rostergroups"] or NULL) do roster_group(row.username, host, row.jid, row.grp); end -for i, row in ipairs(t["vcard"] or NULL) do +for _, row in ipairs(t["vcard"] or NULL) do local stanza, err = parse_xml(row.vcard); if stanza then local ret, err = dm.store(row.username, host, "vcard", st.preserialize(stanza)); @@ -295,7 +295,7 @@ print("[error] vCard XML parse failed: "..row.username.."@"..host); end end -for i, row in ipairs(t["private_storage"] or NULL) do +for _, row in ipairs(t["private_storage"] or NULL) do local stanza, err = parse_xml(row.data); if stanza then private_storage(row.username, host, row.namespace, stanza); @@ -309,7 +309,7 @@ local year, month, day, hour, min, sec = s:match("(....)-?(..)-?(..)T(..):(..):(..)"); return os.time({year=year, month=month, day=day, hour=hour, min=min, sec=sec-time_offset}); end -for i, row in ipairs(t["spool"] or NULL) do +for _, row in ipairs(t["spool"] or NULL) do local stanza, err = parse_xml(row.xml); if stanza then local last_child = stanza.tags[#stanza.tags];