summary refs log tree commit diff
path: root/synapse/storage/events.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2016-03-31 15:09:09 +0100
committerMark Haines <mark.haines@matrix.org>2016-03-31 15:09:09 +0100
commit5d069291696c62c94d795506dd5a22a3dbd019e1 (patch)
tree231ba78c173475bb24ff52f784cfcda9b6f20135 /synapse/storage/events.py
parentRemove the is_new_state argument to persist event. (diff)
downloadsynapse-5d069291696c62c94d795506dd5a22a3dbd019e1.tar.xz
Move the check for backfilled outside the for loop
Diffstat (limited to 'synapse/storage/events.py')
-rw-r--r--synapse/storage/events.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/synapse/storage/events.py b/synapse/storage/events.py
index b5f9b3b900..83279d65fa 100644
--- a/synapse/storage/events.py
+++ b/synapse/storage/events.py
@@ -485,12 +485,12 @@ class EventsStore(SQLBaseStore):
             ],
         )
 
-        for event, _ in state_events_and_contexts:
-            if backfilled:
-                # Backfilled events come before the current state so shouldn't
-                # clobber it.
-                continue
+        if backfilled:
+            # Backfilled events come before the current state so we don't need
+            # to update the current state table
+            return
 
+        for event, _ in state_events_and_contexts:
             if (not event.internal_metadata.is_invite_from_remote()
                     and event.internal_metadata.is_outlier()):
                 # Outlier events generally shouldn't clobber the current state.