mirror of
https://github.com/go-gitea/gitea.git
synced 2024-12-13 16:09:48 +08:00
d547b53cca
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 }) } ``` |
||
---|---|---|
.. | ||
artifact.go | ||
main_test.go | ||
run_job_list.go | ||
run_job.go | ||
run_list.go | ||
run.go | ||
runner_list.go | ||
runner_token_test.go | ||
runner_token.go | ||
runner.go | ||
schedule_list.go | ||
schedule_spec_list.go | ||
schedule_spec.go | ||
schedule.go | ||
status.go | ||
task_list.go | ||
task_output.go | ||
task_step.go | ||
task.go | ||
tasks_version.go | ||
utils_test.go | ||
utils.go | ||
variable.go |