jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1345266?usp=email )

Change subject: textlib: Join template parameter fragments
......................................................................

textlib: Join template parameter fragments

Build parameter text with str.join instead of repeated string
concatenation to avoid repeatedly copying the accumulated text on
Python implementations without concatenation optimizations.

Preserve parameter iteration order, formatting and template delimiters.

Change-Id: If14b81b005d3a9dde1256b14de5413cc17ec27e2
---
M pywikibot/textlib.py
1 file changed, 1 insertion(+), 3 deletions(-)

Approvals:
  jenkins-bot: Verified
  Xqt: Looks good to me, approved




diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index 3a07c66..eceb10b 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -2171,9 +2171,7 @@
     params changes).
     """
     template, params = template_and_params
-    text = ''
-    for items in params.items():
-        text += '|{}={}\n'.format(*items)
+    text = ''.join('|{}={}\n'.format(*items) for items in params.items())

     return f'{{{{{template}\n{text}}}}}'


--
To view, visit 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1345266?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: If14b81b005d3a9dde1256b14de5413cc17ec27e2
Gerrit-Change-Number: 1345266
Gerrit-PatchSet: 2
Gerrit-Owner: Mahveotm <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to