1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

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
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)
}
}