mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-28 23:20:09 +03:00
Speed up get_domain_from_id
This commit is contained in:
parent
b8492b6c2f
commit
f2a5b6dbfd
1 changed files with 3 additions and 3 deletions
|
@ -56,10 +56,10 @@ def create_requester(user_id, access_token_id=None, is_guest=False,
|
|||
|
||||
|
||||
def get_domain_from_id(string):
|
||||
try:
|
||||
return string.split(":", 1)[1]
|
||||
except IndexError:
|
||||
idx = string.find(":")
|
||||
if idx == -1:
|
||||
raise SynapseError(400, "Invalid ID: %r" % (string,))
|
||||
return string[idx + 1:]
|
||||
|
||||
|
||||
class DomainSpecificString(
|
||||
|
|
Loading…
Reference in a new issue