From 15c6b775ff61a2fb5a7c963ef47407075e0d1954 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Wed, 9 Jan 2019 15:03:05 +0100 Subject: Simplify the non-CDATA path of tostring.escape. --- slixmpp/xmlstream/tostring.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'slixmpp/xmlstream/tostring.py') diff --git a/slixmpp/xmlstream/tostring.py b/slixmpp/xmlstream/tostring.py index de6fe47d..d6cc85dd 100644 --- a/slixmpp/xmlstream/tostring.py +++ b/slixmpp/xmlstream/tostring.py @@ -146,10 +146,7 @@ def escape(text, use_cdata=False): '"': '"'} if not use_cdata: - text = list(text) - for i, c in enumerate(text): - text[i] = escapes.get(c, c) - return ''.join(text) + return ''.join(escapes.get(c, c) for c in text) else: escape_needed = False for c in text: -- cgit v1.2.3