mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-28 11:18:52 +03:00
simplify getPendingRepoIDs
This commit is contained in:
parent
44abf6ab47
commit
2db6d5dae9
1 changed files with 2 additions and 4 deletions
|
@ -196,12 +196,10 @@ func (nl NotificationList) LoadAttributes(ctx context.Context) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// getPendingRepoIDs returns all the repositoty ids which haven't been loaded
|
||||||
func (nl NotificationList) getPendingRepoIDs() []int64 {
|
func (nl NotificationList) getPendingRepoIDs() []int64 {
|
||||||
return container.FilterSlice(nl, func(n *Notification) (int64, bool) {
|
return container.FilterSlice(nl, func(n *Notification) (int64, bool) {
|
||||||
if n.Repository != nil {
|
return n.RepoID, n.Repository == nil
|
||||||
return 0, false
|
|
||||||
}
|
|
||||||
return n.RepoID, true
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue