mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-01 03:03:10 -06:00
Potentially reduce number of iterations in `isInAllAuthLists
This commit is contained in:
parent
6340e3e27f
commit
feecbf6ffb
|
|
@ -880,11 +880,12 @@ func (v *StateResolution) resolveConflictsV2(
|
||||||
|
|
||||||
// This function works out if an event exists in all of the auth sets.
|
// This function works out if an event exists in all of the auth sets.
|
||||||
isInAllAuthLists := func(event *gomatrixserverlib.Event) bool {
|
isInAllAuthLists := func(event *gomatrixserverlib.Event) bool {
|
||||||
found := true
|
|
||||||
for k := range authSets {
|
for k := range authSets {
|
||||||
found = found && isInAuthList(k, event)
|
if !isInAuthList(k, event) {
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
return found
|
}
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
// Look through all of the auth events that we've been given and work out if
|
// Look through all of the auth events that we've been given and work out if
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue