summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--slixmpp/xmlstream/tostring.py5
1 files changed, 1 insertions, 4 deletions
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: