jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/609295 )
Change subject: Use set in Page.templatesWithParams
......................................................................
Use set in Page.templatesWithParams
Set membership lookups are faster.
Change-Id: I6cf46fdfe6c8494857f38acc468fc4b90c03b56a
---
M pywikibot/page/__init__.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page/__init__.py b/pywikibot/page/__init__.py
index a4605a0..31468ae 100644
--- a/pywikibot/page/__init__.py
+++ b/pywikibot/page/__init__.py
@@ -2429,7 +2429,7 @@
"""
# WARNING: may not return all templates used in particularly
# intricate cases such as template substitution
- titles = [t.title() for t in self.templates()]
+ titles = {t.title() for t in self.templates()}
templates = self.raw_extracted_templates
# backwards-compatibility: convert the dict returned as the second
# element into a list in the format used by old scripts
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/609295
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I6cf46fdfe6c8494857f38acc468fc4b90c03b56a
Gerrit-Change-Number: 609295
Gerrit-PatchSet: 2
Gerrit-Owner: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged