summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-03-30 17:50:31 +0100
committerErik Johnston <erik@matrix.org>2017-03-30 17:50:31 +0100
commit27b1b4a2c958b04f37732d19f163dcfab12ad0a7 (patch)
treeb1fda3ea1f3aaa02022f25419e9808394fa1d6c8 /synapse
parentMerge pull request #2079 from matrix-org/erikj/push_regex_cache (diff)
downloadsynapse-27b1b4a2c958b04f37732d19f163dcfab12ad0a7.tar.xz
Speed up copy_and_replace
Diffstat (limited to 'synapse')
-rw-r--r--synapse/types.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/synapse/types.py b/synapse/types.py
index 9666f9d73f..c87ed813b9 100644
--- a/synapse/types.py
+++ b/synapse/types.py
@@ -216,9 +216,7 @@ class StreamToken(
             return self
 
     def copy_and_replace(self, key, new_value):
-        d = self._asdict()
-        d[key] = new_value
-        return StreamToken(**d)
+        return self._replace(**{key: new_value})
 
 
 StreamToken.START = StreamToken(