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

Change subject: diff: Return existing plain text from Hunk.__str__
......................................................................

diff: Return existing plain text from Hunk.__str__

The hunk's plain-text diff is already a string. Return it directly
instead of iterating over its characters and joining them again.

Avoid the redundant traversal and string construction while preserving
the returned text.

Change-Id: I5215dd390a68f99c9d6c8f2ccd2567385ab7f399
---
M pywikibot/diff.py
1 file changed, 1 insertion(+), 1 deletion(-)

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




diff --git a/pywikibot/diff.py b/pywikibot/diff.py
index 276fd68..3e157c4 100644
--- a/pywikibot/diff.py
+++ b/pywikibot/diff.py
@@ -200,7 +200,7 @@

     def __str__(self) -> str:
         """Return the diff as plain text."""
-        return ''.join(self.diff_plain_text)
+        return self.diff_plain_text

     def __repr__(self) -> str:
         """Return a reconstructable representation."""

--
To view, visit 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1340520?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: I5215dd390a68f99c9d6c8f2ccd2567385ab7f399
Gerrit-Change-Number: 1340520
Gerrit-PatchSet: 1
Gerrit-Owner: Mahveotm <[email protected]>
Gerrit-Reviewer: Mahveotm <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to