mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto
synced 2024-11-24 08:14:09 +00:00
Merge "Simplify mw.text.listToText"
This commit is contained in:
commit
160770ae3e
|
@ -240,10 +240,7 @@ function mwtext.listToText( list, separator, conjunction )
|
||||||
|
|
||||||
local ret
|
local ret
|
||||||
if n > 1 then
|
if n > 1 then
|
||||||
local tmp = list[n-1]
|
ret = table.concat( list, separator, 1, n - 1 ) .. conjunction .. list[n]
|
||||||
list[n-1] = list[n-1] .. conjunction .. list[n]
|
|
||||||
ret = table.concat( list, separator, 1, n - 1 )
|
|
||||||
list[n-1] = tmp
|
|
||||||
else
|
else
|
||||||
ret = tostring( list[1] or '' )
|
ret = tostring( list[1] or '' )
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue