mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-15 14:32:42 +00:00
Replace util.SliceXxx
with slices.Xxx
(#26958)
This commit is contained in:
parent
e97e883ad5
commit
a78c2eae24
16 changed files with 46 additions and 110 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue