diff options
author | Erik Johnston <erikj@jki.re> | 2017-03-31 09:39:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-31 09:39:54 +0100 |
commit | 639d9ae9a0b14dba59982dc71bb981252f6b8f78 (patch) | |
tree | b1fda3ea1f3aaa02022f25419e9808394fa1d6c8 | |
parent | Merge pull request #2079 from matrix-org/erikj/push_regex_cache (diff) | |
parent | Speed up copy_and_replace (diff) | |
download | synapse-639d9ae9a0b14dba59982dc71bb981252f6b8f78.tar.xz |
Merge pull request #2083 from matrix-org/erikj/copy_replace_speed
Speed up copy_and_replace
-rw-r--r-- | synapse/types.py | 4 |
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( |