mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-07 14:13:11 -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
|
// possible malicious actors) can't completely corrupt the room state
|
||||||
// away from what it was before.
|
// away from what it was before.
|
||||||
combinedExtremities := types.StateAtEventAndReferences(append(u.oldLatest, u.latest...))
|
combinedExtremities := types.StateAtEventAndReferences(append(u.oldLatest, u.latest...))
|
||||||
util.SortAndUnique(combinedExtremities)
|
combinedExtremities = combinedExtremities[:util.SortAndUnique(combinedExtremities)]
|
||||||
latestStateAtEvents := make([]types.StateAtEvent, len(combinedExtremities))
|
latestStateAtEvents := make([]types.StateAtEvent, len(combinedExtremities))
|
||||||
for i := range combinedExtremities {
|
for i := range combinedExtremities {
|
||||||
latestStateAtEvents[i] = combinedExtremities[i].StateAtEvent
|
latestStateAtEvents[i] = combinedExtremities[i].StateAtEvent
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue