mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-23 11:01:49 +01:00
Partial revert of "Refactor more filterslice (gitea#30370)"
This reverts commit 44abf6ab47
.
This commit is contained in:
parent
2db6d5dae9
commit
b125b3e3aa
1 changed files with 6 additions and 5 deletions
|
@ -21,15 +21,16 @@ type IssueList []*Issue
|
|||
|
||||
// get the repo IDs to be loaded later, these IDs are for issue.Repo and issue.PullRequest.HeadRepo
|
||||
func (issues IssueList) getRepoIDs() []int64 {
|
||||
return container.FilterSlice(issues, func(issue *Issue) (int64, bool) {
|
||||
repoIDs := make(container.Set[int64], len(issues))
|
||||
for _, issue := range issues {
|
||||
if issue.Repo == nil {
|
||||
return issue.RepoID, true
|
||||
repoIDs.Add(issue.RepoID)
|
||||
}
|
||||
if issue.PullRequest != nil && issue.PullRequest.HeadRepo == nil {
|
||||
return issue.PullRequest.HeadRepoID, true
|
||||
repoIDs.Add(issue.PullRequest.HeadRepoID)
|
||||
}
|
||||
return 0, false
|
||||
})
|
||||
}
|
||||
return repoIDs.Values()
|
||||
}
|
||||
|
||||
// LoadRepositories loads issues' all repositories
|
||||
|
|
Loading…
Reference in a new issue