mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-26 00:03:09 -06:00
Minor optimisation
This commit is contained in:
parent
414d974cf5
commit
61f457c4d9
|
|
@ -255,10 +255,10 @@ func (u *latestEventsUpdater) calculateLatest(
|
||||||
// forward extremities reference.
|
// forward extremities reference.
|
||||||
existingIDs := make(map[string]*types.StateAtEventAndReference)
|
existingIDs := make(map[string]*types.StateAtEventAndReference)
|
||||||
existingPrevs := make(map[string]struct{})
|
existingPrevs := make(map[string]struct{})
|
||||||
existingNIDs := []types.EventNID{}
|
existingNIDs := make([]types.EventNID, len(oldLatest))
|
||||||
for i, old := range oldLatest {
|
for i, old := range oldLatest {
|
||||||
existingIDs[old.EventID] = &oldLatest[i]
|
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
|
// Look up the old extremity events. This allows us to find their
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue