Micro-optimise _format_jid.

This commit is contained in:
Emmanuel Gil Peyrot 2016-08-21 20:26:51 +01:00
parent 39ee833c29
commit e28318c271

View File

@ -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):