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

Commit

Permalink
Merge pull request #2083 from matrix-org/erikj/copy_replace_speed
Browse files Browse the repository at this point in the history
Speed up copy_and_replace
  • Loading branch information
erikjohnston authored Mar 31, 2017
2 parents 0834d1a + 27b1b4a commit 639d9ae
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions synapse/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,7 @@ def copy_and_advance(self, key, new_value):
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(
Expand Down

0 comments on commit 639d9ae

Please sign in to comment.