mirror of https://github.com/go-gitea/gitea.git
Many places have the following logic: ```go func (jobs ActionJobList) GetRunIDs() []int64 { ids := make(container.Set[int64], len(jobs)) for _, j := range jobs { if j.RunID == 0 { continue } ids.Add(j.RunID) } return ids.Values() } ``` this introduces a `container.FilterMapUnique` function, which reduces the code above to: ```go func (jobs ActionJobList) GetRunIDs() []int64 { return container.FilterMapUnique(jobs, func(j *ActionRunJob) (int64, bool) { return j.RunID, j.RunID != 0 }) } ``` |
11 months ago | |
---|---|---|
.. | ||
action.go | 12 months ago | |
action_list.go | 11 months ago | |
action_test.go | 1 year ago | |
main_test.go | 1 year ago | |
notification.go | 12 months ago | |
notification_list.go | 11 months ago | |
notification_test.go | 1 year ago | |
repo_activity.go | 1 year ago | |
statistic.go | 12 months ago | |
user_heatmap.go | 1 year ago | |
user_heatmap_test.go | 1 year ago |