Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-11-25 11:16:11 +01:00

simplify getPendingRepoIDs

This commit is contained in:
oliverpool 2024-04-16 11:53:18 +02:00
parent 44abf6ab47
commit 2db6d5dae9

View file

@ -196,12 +196,10 @@ func (nl NotificationList) LoadAttributes(ctx context.Context) error {
return nil
}
// getPendingRepoIDs returns all the repositoty ids which haven't been loaded
func (nl NotificationList) getPendingRepoIDs() []int64 {
return container.FilterSlice(nl, func(n *Notification) (int64, bool) {
if n.Repository != nil {
return 0, false
}
return n.RepoID, true
return n.RepoID, n.Repository == nil
})
}