mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-06 13:43:09 -06:00
Trim the slice properly
This commit is contained in:
parent
c08d16f8c9
commit
ba15aebcd6
|
|
@ -242,7 +242,7 @@ func (u *latestEventsUpdater) latestState() error {
|
|||
// possible malicious actors) can't completely corrupt the room state
|
||||
// away from what it was before.
|
||||
combinedExtremities := types.StateAtEventAndReferences(append(u.oldLatest, u.latest...))
|
||||
util.SortAndUnique(combinedExtremities)
|
||||
combinedExtremities = combinedExtremities[:util.SortAndUnique(combinedExtremities)]
|
||||
latestStateAtEvents := make([]types.StateAtEvent, len(combinedExtremities))
|
||||
for i := range combinedExtremities {
|
||||
latestStateAtEvents[i] = combinedExtremities[i].StateAtEvent
|
||||
|
|
|
|||
Loading…
Reference in a new issue