From 2db6d5dae9e7052564b5dbef62b6fc5140177954 Mon Sep 17 00:00:00 2001 From: oliverpool Date: Tue, 16 Apr 2024 11:53:18 +0200 Subject: [PATCH] simplify getPendingRepoIDs --- models/activities/notification_list.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/models/activities/notification_list.go b/models/activities/notification_list.go index e70fa9c7b..32d2a5c05 100644 --- a/models/activities/notification_list.go +++ b/models/activities/notification_list.go @@ -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 }) }