summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2019-01-09 15:03:05 +0100
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2019-01-09 15:03:05 +0100
commit15c6b775ff61a2fb5a7c963ef47407075e0d1954 (patch)
tree7a64e12499e1afb4e23a32d5581ed0f0251bf55d
parent4b482477e295bac0a7e3777883579de3ece3d7e0 (diff)
downloadslixmpp-15c6b775ff61a2fb5a7c963ef47407075e0d1954.tar.gz
slixmpp-15c6b775ff61a2fb5a7c963ef47407075e0d1954.tar.bz2
slixmpp-15c6b775ff61a2fb5a7c963ef47407075e0d1954.tar.xz
slixmpp-15c6b775ff61a2fb5a7c963ef47407075e0d1954.zip
Simplify the non-CDATA path of tostring.escape.
-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):
'"': '&quot;'}
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: