summaryrefslogtreecommitdiffstats
path: root/models/migrate.go
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2022-10-12 07:18:26 +0200
committerGitHub <noreply@github.com>2022-10-12 13:18:26 +0800
commit0e57ff7eee4ac71d923f970d15889ad4d50f97a9 (patch)
treee5a92c55af5366924bd40ae14b4bf12842239193 /models/migrate.go
parente84558b0931309cf1f4f2767bc47296483b9b3e1 (diff)
downloadgitea-0e57ff7eee4ac71d923f970d15889ad4d50f97a9.tar.gz
gitea-0e57ff7eee4ac71d923f970d15889ad4d50f97a9.zip
Add generic set type (#21408)
This PR adds a generic set type to get rid of maps used as sets. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'models/migrate.go')
-rw-r--r--models/migrate.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/models/migrate.go b/models/migrate.go
index f6bceaa019..d842fb967b 100644
--- a/models/migrate.go
+++ b/models/migrate.go
@@ -10,6 +10,7 @@ import (
"code.gitea.io/gitea/models/db"
issues_model "code.gitea.io/gitea/models/issues"
repo_model "code.gitea.io/gitea/models/repo"
+ "code.gitea.io/gitea/modules/container"
"code.gitea.io/gitea/modules/structs"
)
@@ -99,9 +100,9 @@ func InsertIssueComments(comments []*issues_model.Comment) error {
return nil
}
- issueIDs := make(map[int64]bool)
+ issueIDs := make(container.Set[int64])
for _, comment := range comments {
- issueIDs[comment.IssueID] = true
+ issueIDs.Add(comment.IssueID)
}
ctx, committer, err := db.TxContext()