Use Set[Type] instead of map[Type]bool/struct{}. (#26804)

This commit is contained in:
KN4CK3R 2023-08-30 08:55:25 +02:00 committed by GitHub
parent 815d267c80
commit 5315153059
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 36 additions and 48 deletions

View file

@ -567,12 +567,9 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) {
// Remove repositories that should not be shown,
// which are repositories that have no issues and are not selected by the user.
selectedReposMap := make(map[int64]struct{}, len(selectedRepoIDs))
for _, repoID := range selectedRepoIDs {
selectedReposMap[repoID] = struct{}{}
}
selectedRepos := container.SetOf(selectedRepoIDs...)
for k, v := range issueCountByRepo {
if _, ok := selectedReposMap[k]; !ok && v == 0 {
if v == 0 && !selectedRepos.Contains(k) {
delete(issueCountByRepo, k)
}
}