Minor optimisation

This commit is contained in:
Neil Alexander 2020-10-21 14:29:49 +01:00
parent 414d974cf5
commit 61f457c4d9
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -255,10 +255,10 @@ func (u *latestEventsUpdater) calculateLatest(
// forward extremities reference.
existingIDs := make(map[string]*types.StateAtEventAndReference)
existingPrevs := make(map[string]struct{})
existingNIDs := []types.EventNID{}
existingNIDs := make([]types.EventNID, len(oldLatest))
for i, old := range oldLatest {
existingIDs[old.EventID] = &oldLatest[i]
existingNIDs = append(existingNIDs, old.EventNID)
existingNIDs[i] = old.EventNID
}
// Look up the old extremity events. This allows us to find their