From 27b1b4a2c958b04f37732d19f163dcfab12ad0a7 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Thu, 30 Mar 2017 17:50:31 +0100 Subject: [PATCH] Speed up copy_and_replace --- synapse/types.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/synapse/types.py b/synapse/types.py index 9666f9d73f34..c87ed813b9af 100644 --- a/synapse/types.py +++ b/synapse/types.py @@ -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(