summaryrefslogtreecommitdiffstats
path: root/services/issue/commit.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/issue/commit.go')
-rw-r--r--services/issue/commit.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/services/issue/commit.go b/services/issue/commit.go
index 0d04de81bc..c8cfa6cc8a 100644
--- a/services/issue/commit.go
+++ b/services/issue/commit.go
@@ -18,6 +18,7 @@ import (
access_model "code.gitea.io/gitea/models/perm/access"
repo_model "code.gitea.io/gitea/models/repo"
user_model "code.gitea.io/gitea/models/user"
+ "code.gitea.io/gitea/modules/container"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/references"
"code.gitea.io/gitea/modules/repository"
@@ -111,7 +112,7 @@ func UpdateIssuesCommit(doer *user_model.User, repo *repo_model.Repository, comm
Action references.XRefAction
}
- refMarked := make(map[markKey]bool)
+ refMarked := make(container.Set[markKey])
var refRepo *repo_model.Repository
var refIssue *issues_model.Issue
var err error
@@ -144,10 +145,9 @@ func UpdateIssuesCommit(doer *user_model.User, repo *repo_model.Repository, comm
}
key := markKey{ID: refIssue.ID, Action: ref.Action}
- if refMarked[key] {
+ if !refMarked.Add(key) {
continue
}
- refMarked[key] = true
// FIXME: this kind of condition is all over the code, it should be consolidated in a single place
canclose := perm.IsAdmin() || perm.IsOwner() || perm.CanWriteIssuesOrPulls(refIssue.IsPull) || refIssue.PosterID == doer.ID