diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2020-10-21 15:37:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-21 15:37:07 +0100 |
commit | 534f9a9eb69ad35c7492c18c65cdbd55892bf930 (patch) | |
tree | 2eb0608e2084fc60599d719ff631ba4a412b1c63 /roomserver/state | |
parent | e4f3f38f35ad14a581bed481352a6c1efeb56115 (diff) |
Refactor forward extremities (#1556)
* Add resolve-state helper
* Tweaks
* Refactor forward extremities, again
* Tweaks
* Minor optimisation
* Make path a bit clearer
* Only process state/membership if forward extremities have changed
* Usage comments in resolve-state
Diffstat (limited to 'roomserver/state')
-rw-r--r-- | roomserver/state/state.go | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/roomserver/state/state.go b/roomserver/state/state.go index 2944f71c..d23f14c8 100644 --- a/roomserver/state/state.go +++ b/roomserver/state/state.go @@ -526,13 +526,7 @@ func (v StateResolution) CalculateAndStoreStateBeforeEvent( isRejected bool, ) (types.StateSnapshotNID, error) { // Load the state at the prev events. - prevEventRefs := event.PrevEvents() - prevEventIDs := make([]string, len(prevEventRefs)) - for i := range prevEventRefs { - prevEventIDs[i] = prevEventRefs[i].EventID - } - - prevStates, err := v.db.StateAtEventIDs(ctx, prevEventIDs) + prevStates, err := v.db.StateAtEventIDs(ctx, event.PrevEventIDs()) if err != nil { return 0, err } |