mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-11-01 06:51:18 +00:00
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
})
}
```
Conflicts:
models/issues/comment_list.go due to premature refactor in #3116
|
||
|---|---|---|
| .. | ||
| TestIterateRepositoryIDsWithLFSMetaObjects | ||
| branch.go | ||
| branch_list.go | ||
| branch_test.go | ||
| commit_status.go | ||
| commit_status_test.go | ||
| lfs.go | ||
| lfs_lock.go | ||
| lfs_test.go | ||
| main_test.go | ||
| protected_banch_list_test.go | ||
| protected_branch.go | ||
| protected_branch_list.go | ||
| protected_branch_test.go | ||
| protected_tag.go | ||
| protected_tag_test.go | ||