Module:Rail-interchange multi and Module:Rail-interchange multi/sandbox: Difference between pages

(Difference between pages)
Jump to navigation Jump to search
Page 1
Page 2
imported>Jc86035
m fix behaviour
 
imported>Lemondoge
Simplification & efficiency improvement, bug fix
 
Line 17: Line 17:
end
end
for i2, v2 in ipairs(tmp) do
for i2, v2 in ipairs(tmp) do
if i2 < 5 then
if i2 == 1 then
if i2 == 1 then
args[i2] = (string.find((v2 or ''), '^%s*$') and default or v2)
args[i2] = (string.find((v2 or ''), '^%s*$') and default or v2)
elseif i2 < 5 then
else
args[i2] = (not string.find((v2 or ''), '^%s*$') and v2 or nil)
args[i2] = (string.find((v2 or ''), '^%s*$') and nil or v2)
else
end
break
end
end
end
end
Line 53: Line 53:
end
end
for i2, v2 in ipairs(tmp) do
for i2, v2 in ipairs(tmp) do
if i2 < 5 then
if i2 == 1 then
if i2 == 1 then
args[i2] = (string.find((v2 or ''), '^%s*$') and default or v2)
args[i2] = (string.find((v2 or ''), '^%s*$') and default or v2)
elseif i2 < 5 then
else
args[i2] = (not string.find((v2 or ''), '^%s*$') and v2 or nil)
args[i2] = (string.find((v2 or ''), '^%s*$') and nil or v2)
else
end
break
end
end
end
end