diff options
author | CaiCandong <50507092+CaiCandong@users.noreply.github.com> | 2023-09-07 17:37:47 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-07 09:37:47 +0000 |
commit | a78c2eae243077c1fed5f7b056c64072d3c63ac8 (patch) | |
tree | 53b63a8dafde117e76f5fede968e384ae55779b1 /models/issues | |
parent | e97e883ad50774f249c8c694598c25a17227299b (diff) | |
download | gitea-a78c2eae243077c1fed5f7b056c64072d3c63ac8.tar.gz gitea-a78c2eae243077c1fed5f7b056c64072d3c63ac8.zip |
Replace `util.SliceXxx` with `slices.Xxx` (#26958)
Diffstat (limited to 'models/issues')
-rw-r--r-- | models/issues/issue.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/models/issues/issue.go b/models/issues/issue.go index f000f4c660..8f59c9cb42 100644 --- a/models/issues/issue.go +++ b/models/issues/issue.go @@ -8,6 +8,7 @@ import ( "context" "fmt" "regexp" + "slices" "code.gitea.io/gitea/models/db" project_model "code.gitea.io/gitea/models/project" @@ -605,7 +606,7 @@ func IsUserParticipantsOfIssue(user *user_model.User, issue *Issue) bool { log.Error(err.Error()) return false } - return util.SliceContains(userIDs, user.ID) + return slices.Contains(userIDs, user.ID) } // DependencyInfo represents high level information about an issue which is a dependency of another issue. @@ -630,7 +631,7 @@ func (issue *Issue) GetParticipantIDsByIssue(ctx context.Context) ([]int64, erro Find(&userIDs); err != nil { return nil, fmt.Errorf("get poster IDs: %w", err) } - if !util.SliceContains(userIDs, issue.PosterID) { + if !slices.Contains(userIDs, issue.PosterID) { return append(userIDs, issue.PosterID), nil } return userIDs, nil |