Potentially reduce number of iterations in `isInAllAuthLists

This commit is contained in:
Neil Alexander 2022-02-24 10:40:36 +00:00
parent 6340e3e27f
commit feecbf6ffb
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -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