jenkins-bot merged this change.
[IMPR] Faster lookup for write actions
Use a set instead a tuple for loopup which is upto
20 times faster.
Change-Id: I5b767a94a4352ff376d369cf11dc19be14dda09e
---
M pywikibot/data/api.py
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index d65bf7e..cca8864 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -1221,7 +1221,7 @@
# Actions that imply database updates on the server, used for various
# things like throttling or skipping actions when we're in simulation
# mode
- self.write = self.action in (
+ self.write = self.action in {
'block', 'clearhasmsg', 'createaccount', 'delete', 'edit',
'emailuser', 'filerevert', 'flowthank', 'imagerotate', 'import',
'managetags', 'mergehistory', 'move', 'options', 'patrol',
@@ -1233,7 +1233,7 @@
'wbremovequalifiers', 'wbremovereferences', 'wbsetaliases',
'wbsetclaim', 'wbsetclaimvalue', 'wbsetdescription', 'wbsetlabel',
'wbsetqualifier', 'wbsetreference', 'wbsetsitelink',
- )
+ }
# Client side verification that the request is being performed
# by a logged in user, and warn if it isn't a config username.
if self.write:
To view, visit change 594524. To unsubscribe, or for help writing mail filters, visit settings.