make higherPrios a simple slice

This commit is contained in:
tobi 2025-01-07 17:52:28 +01:00
commit 480ce48a3e
2 changed files with 8 additions and 19 deletions

View file

@ -322,11 +322,6 @@ func (p *Processor) DomainPermissionSubscriptionTest(
},
)
// Everything *before* the targeted subscription has a higher priority.
getHigherPrios := func() ([]*gtsmodel.DomainPermissionSubscription, error) {
return permSubs[:index], nil
}
// Get a transport for calling permSub.URI.
tsport, err := p.transport.NewTransportForUsername(ctx, acct.Username)
if err != nil {
@ -334,6 +329,10 @@ func (p *Processor) DomainPermissionSubscriptionTest(
return nil, gtserror.NewErrorInternalError(err)
}
// Everything *before* the targeted
// subscription has a higher priority.
higherPrios := permSubs[:index]
// Call the permSub.URI and parse a list of perms from it.
// Any error returned here is a "real" one, not an error
// from fetching / parsing the list.
@ -341,7 +340,7 @@ func (p *Processor) DomainPermissionSubscriptionTest(
ctx,
permSub,
tsport,
getHigherPrios,
higherPrios,
true, // Dry run.
)
if err != nil {