|
|
@ -21,16 +21,15 @@ type IssueList []*Issue |
|
|
|
|
|
|
|
|
|
|
|
// get the repo IDs to be loaded later, these IDs are for issue.Repo and issue.PullRequest.HeadRepo
|
|
|
|
// get the repo IDs to be loaded later, these IDs are for issue.Repo and issue.PullRequest.HeadRepo
|
|
|
|
func (issues IssueList) getRepoIDs() []int64 { |
|
|
|
func (issues IssueList) getRepoIDs() []int64 { |
|
|
|
repoIDs := make(container.Set[int64], len(issues)) |
|
|
|
return container.FilterSlice(issues, func(issue *Issue) (int64, bool) { |
|
|
|
for _, issue := range issues { |
|
|
|
|
|
|
|
if issue.Repo == nil { |
|
|
|
if issue.Repo == nil { |
|
|
|
repoIDs.Add(issue.RepoID) |
|
|
|
return issue.RepoID, true |
|
|
|
} |
|
|
|
} |
|
|
|
if issue.PullRequest != nil && issue.PullRequest.HeadRepo == nil { |
|
|
|
if issue.PullRequest != nil && issue.PullRequest.HeadRepo == nil { |
|
|
|
repoIDs.Add(issue.PullRequest.HeadRepoID) |
|
|
|
return issue.PullRequest.HeadRepoID, true |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return 0, false |
|
|
|
return repoIDs.Values() |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// LoadRepositories loads issues' all repositories
|
|
|
|
// LoadRepositories loads issues' all repositories
|
|
|
|