From a78c2eae243077c1fed5f7b056c64072d3c63ac8 Mon Sep 17 00:00:00 2001 From: CaiCandong <50507092+CaiCandong@users.noreply.github.com> Date: Thu, 7 Sep 2023 17:37:47 +0800 Subject: Replace `util.SliceXxx` with `slices.Xxx` (#26958) --- models/issues/issue.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'models/issues') 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 -- cgit v1.2.3