jenkins-bot submitted this change.
tools: Use isdisjoint for invisible character check
Delegate the overlap check to frozenset.isdisjoint instead of iterating
through a Python generator.
Change-Id: I4822f5f9684e7f184f712c728458166c0a0bbbbe
---
M pywikibot/tools/chars.py
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pywikibot/tools/chars.py b/pywikibot/tools/chars.py
index 9ed74f1..c49d8a4 100644
--- a/pywikibot/tools/chars.py
+++ b/pywikibot/tools/chars.py
@@ -24,7 +24,7 @@
def contains_invisible(text):
"""Return True if the text contain any of the invisible characters."""
- return any(char in _invisible_chars for char in text)
+ return not _invisible_chars.isdisjoint(text)
def replace_invisible(text):
To view, visit change 1330579. To unsubscribe, or for help writing mail filters, visit settings.