Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Speed up get_domain_from_id #2226

Merged
merged 1 commit into from
May 16, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions synapse/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down