summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-01-17 14:59:03 +0000
committerErik Johnston <erik@matrix.org>2017-01-17 14:59:03 +0000
commita8594fd19f48a179b263d58ba1f9c5ab2f4cb8d3 (patch)
tree5c54b2e8ad95be5076d69a4d22dc86219406920b
parentUse better variable name (diff)
downloadsynapse-a8594fd19f48a179b263d58ba1f9c5ab2f4cb8d3.tar.xz
Use better names
Diffstat (limited to '')
-rw-r--r--synapse/state.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/synapse/state.py b/synapse/state.py
index d2bd1ad646..6f62876f8c 100644
--- a/synapse/state.py
+++ b/synapse/state.py
@@ -517,21 +517,19 @@ def _create_auth_events_from_maps(unconflicted_state, conflicted_state, state_ma
     return auth_events
 
 
-def _resolve_with_state(unconflicted_state, conflicted_state, auth_events,
+def _resolve_with_state(unconflicted_state_ids, conflicted_state_ds, auth_event_ids,
                         state_map):
-    new_conflicted_state = {}
-    for key, event_ids in conflicted_state.iteritems():
+    conflicted_state = {}
+    for key, event_ids in conflicted_state_ds.iteritems():
         events = [state_map[ev_id] for ev_id in event_ids if ev_id in state_map]
         if len(events) > 1:
-            new_conflicted_state[key] = events
+            conflicted_state[key] = events
         elif len(events) == 1:
-            unconflicted_state[key] = events[0].event_id
-
-    conflicted_state = new_conflicted_state
+            unconflicted_state_ids[key] = events[0].event_id
 
     auth_events = {
         key: state_map[ev_id]
-        for key, ev_id in auth_events.items()
+        for key, ev_id in auth_event_ids.items()
         if ev_id in state_map
     }
 
@@ -543,7 +541,7 @@ def _resolve_with_state(unconflicted_state, conflicted_state, auth_events,
         logger.exception("Failed to resolve state")
         raise
 
-    new_state = unconflicted_state
+    new_state = unconflicted_state_ids
     for key, event in resolved_state.iteritems():
         new_state[key] = event.event_id