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
|
||||
if n > 1 then
|
||||
local tmp = list[n-1]
|
||||
list[n-1] = list[n-1] .. conjunction .. list[n]
|
||||
ret = table.concat( list, separator, 1, n - 1 )
|
||||
list[n-1] = tmp
|
||||
ret = table.concat( list, separator, 1, n - 1 ) .. conjunction .. list[n]
|
||||
else
|
||||
ret = tostring( list[1] or '' )
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue