diff options
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2019-01-09 15:03:05 +0100 |
---|---|---|
committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2019-01-09 15:03:05 +0100 |
commit | 15c6b775ff61a2fb5a7c963ef47407075e0d1954 (patch) | |
tree | 7a64e12499e1afb4e23a32d5581ed0f0251bf55d | |
parent | 4b482477e295bac0a7e3777883579de3ece3d7e0 (diff) | |
download | slixmpp-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.py | 5 |
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: |