summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2017-05-16 17:18:16 +0100
committerGitHub <noreply@github.com>2017-05-16 17:18:16 +0100
commit11bc21b6d9a46e8bb4ca1ecf9b45dd78548adb8b (patch)
tree4de2f21de5d74d99d5875cf87ffd09000647da69 /synapse
parentMerge pull request #2224 from matrix-org/erikj/prefill_state (diff)
parentSpeed up get_domain_from_id (diff)
downloadsynapse-11bc21b6d9a46e8bb4ca1ecf9b45dd78548adb8b.tar.xz
Merge pull request #2226 from matrix-org/erikj/domain_from_id
Speed up get_domain_from_id
Diffstat (limited to 'synapse')
-rw-r--r--synapse/types.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/types.py b/synapse/types.py
index c87ed813b9..445bdcb4d7 100644
--- a/synapse/types.py
+++ b/synapse/types.py
@@ -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(