Modul:Redirect hatnote: Unterschied zwischen den Versionen
use a repeat ... until loop to avoid creating an unnecessary blank table
(Ok, I think this got it) |
(use a repeat ... until loop to avoid creating an unnecessary blank table) |
||
Zeile 14: | Zeile 14: | ||
-- Get the args table and work out the maximum arg key. | -- Get the args table and work out the maximum arg key. | ||
local origArgs = frame:getParent().args | local origArgs = frame:getParent().args | ||
local args = {} | local args = {} | ||
Zeile 25: | Zeile 24: | ||
if v ~= '' then | if v ~= '' then | ||
args[k] = v | args[k] = v | ||
end | end | ||
end | end | ||
Zeile 51: | Zeile 41: | ||
local iArg = 0 | local iArg = 0 | ||
local iData = 1 | local iData = 1 | ||
repeat | |||
iArg = iArg + 2 | iArg = iArg + 2 | ||
local useTable = data[iData] or {} | local useTable = data[iData] or {} | ||
Zeile 65: | Zeile 55: | ||
iData = iData + 1 | iData = iData + 1 | ||
end | end | ||
until iArg >= maxArg - 1 | |||
-- Create the options table. | -- Create the options table. |