Module:TNT: Difference between revisions

3 bytes added ,  2 years ago
use ipairs to guarantee iteration over integer keys starting at 1 (pairs happens to iterate that way very often, but a case where it does not has been reported on the talk page)
m (Changed protection level for "Module:TNT": High-risk Lua module: per request at WP:RFPP to match Module:Excerpt ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite)))
(use ipairs to guarantee iteration over integer keys starting at 1 (pairs happens to iterate that way very often, but a case where it does not has been reported on the talk page))
Line 96:
local data = loadData(dataset)
local names = {}
for _, field in pairsipairs(data.schema.fields) do
table.insert(names, field.name)
end
Line 102:
local params = {}
local paramOrder = {}
for _, row in pairsipairs(data.data) do
local newVal = {}
local name = nil
for pos, val in pairsipairs(row) do
local columnName = names[pos]
if columnName == 'name' then
Anonymous user