Commit e28318c2 authored by Link Mauve's avatar Link Mauve

Micro-optimise _format_jid.

parent 39ee833c
......@@ -208,16 +208,15 @@ def _format_jid(local=None, domain=None, resource=None):
:return: A full or bare JID string.
"""
result = []
if domain is None:
return ''
if local is not None:
result.append(local)
result.append('@')
if domain is not None:
result.append(domain)
result = local + '@' + domain
else:
result = domain
if resource is not None:
result.append('/')
result.append(resource)
return ''.join(result)
result += '/' + resource
return result
class InvalidJID(ValueError):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment