mirror of
https://github.com/1f349/dendrite.git
synced 2024-11-22 03:31:41 +00:00
parent
5b969d172b
commit
b99f594a93
@ -165,13 +165,20 @@ func (d *Database) AddState(
|
||||
if berr != nil {
|
||||
return 0, fmt.Errorf("d.StateBlockTable.BulkSelectStateBlockEntries: %w", berr)
|
||||
}
|
||||
var found bool
|
||||
for i := len(state) - 1; i >= 0; i-- {
|
||||
found = false
|
||||
for _, events := range blocks {
|
||||
for _, event := range events {
|
||||
if state[i].EventNID == event {
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if found {
|
||||
state = append(state[:i], state[i+1:]...)
|
||||
}
|
||||
}
|
||||
i--
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user