summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-02-10 11:01:15 +0000
committerErik Johnston <erik@matrix.org>2015-02-10 11:01:15 +0000
commitd19e2ed02fb545bde9c8d1a317f07b9fb786d2c5 (patch)
tree429ca5892e7a97d1e049f65a3097a5f7a2db864a /synapse
parentFix tests (diff)
downloadsynapse-d19e2ed02fb545bde9c8d1a317f07b9fb786d2c5.tar.xz
Move construction of object within if block
Diffstat (limited to '')
-rw-r--r--synapse/state.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/synapse/state.py b/synapse/state.py
index 49ac09863e..2dea8f552a 100644
--- a/synapse/state.py
+++ b/synapse/state.py
@@ -306,13 +306,13 @@ class StateHandler(object):
         new_state = unconflicted_state
         new_state.update(resolved_state)
 
-        cache = _StateCacheEntry(
-            state=new_state,
-            state_group=None,
-            ts=self.clock.time_msec()
-        )
-
         if self._state_cache is not None:
+            cache = _StateCacheEntry(
+                state=new_state,
+                state_group=None,
+                ts=self.clock.time_msec()
+            )
+
             self._state_cache[frozenset(event_ids)] = cache
 
         defer.returnValue((None, new_state, prev_states))