Mr. Stradivarius has uploaded a new change for review.
https://gerrit.wikimedia.org/r/146049
Change subject: Simplify mw.text.listToText
......................................................................
Simplify mw.text.listToText
Simplify the logic in mw.text.listToText so that we don't need to add or
remove anything from the original table we were passed.
Change-Id: I3efcbba1b9adc9a9e32e366e355cb742376cd91b
---
M engines/LuaCommon/lualib/mw.text.lua
1 file changed, 1 insertion(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Scribunto
refs/changes/49/146049/1
diff --git a/engines/LuaCommon/lualib/mw.text.lua
b/engines/LuaCommon/lualib/mw.text.lua
index 0191442..e639228 100644
--- a/engines/LuaCommon/lualib/mw.text.lua
+++ b/engines/LuaCommon/lualib/mw.text.lua
@@ -240,10 +240,7 @@
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
--
To view, visit https://gerrit.wikimedia.org/r/146049
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3efcbba1b9adc9a9e32e366e355cb742376cd91b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Scribunto
Gerrit-Branch: master
Gerrit-Owner: Mr. Stradivarius <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits