Micro-optimise _format_jid.
This commit is contained in:
parent
39ee833c29
commit
e28318c271
@ -208,16 +208,15 @@ def _format_jid(local=None, domain=None, resource=None):
|
|||||||
|
|
||||||
:return: A full or bare JID string.
|
:return: A full or bare JID string.
|
||||||
"""
|
"""
|
||||||
result = []
|
if domain is None:
|
||||||
|
return ''
|
||||||
if local is not None:
|
if local is not None:
|
||||||
result.append(local)
|
result = local + '@' + domain
|
||||||
result.append('@')
|
else:
|
||||||
if domain is not None:
|
result = domain
|
||||||
result.append(domain)
|
|
||||||
if resource is not None:
|
if resource is not None:
|
||||||
result.append('/')
|
result += '/' + resource
|
||||||
result.append(resource)
|
return result
|
||||||
return ''.join(result)
|
|
||||||
|
|
||||||
|
|
||||||
class InvalidJID(ValueError):
|
class InvalidJID(ValueError):
|
||||||
|
Loading…
Reference in New Issue
Block a user