diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-12-28 17:38:59 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-28 09:38:59 +0000 |
commit | f3999888c0b765380003f814f9c3d5cf80128167 (patch) | |
tree | 757e14c4cff65a4f123c248ceda20960ee8144ca /models/issues | |
parent | 921df1cbad83dcba37ff12cba88c7d3a69f8588b (diff) | |
download | gitea-f3999888c0b765380003f814f9c3d5cf80128167.tar.gz gitea-f3999888c0b765380003f814f9c3d5cf80128167.zip |
Refactor some legacy code and remove unused code (#28622)
1. use slices.Contains, remove Int64sContains
2. use HashEmail, remove base.EncodeMD5
3. remove BasicAuthEncode, IsLetter
Diffstat (limited to 'models/issues')
-rw-r--r-- | models/issues/review.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/models/issues/review.go b/models/issues/review.go index e06670c9a1..4cbfa4f443 100644 --- a/models/issues/review.go +++ b/models/issues/review.go @@ -6,6 +6,7 @@ package issues import ( "context" "fmt" + "slices" "strings" "code.gitea.io/gitea/models/db" @@ -15,7 +16,6 @@ import ( access_model "code.gitea.io/gitea/models/perm/access" "code.gitea.io/gitea/models/unit" user_model "code.gitea.io/gitea/models/user" - "code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/structs" "code.gitea.io/gitea/modules/timeutil" "code.gitea.io/gitea/modules/util" @@ -279,7 +279,7 @@ func IsOfficialReviewerTeam(ctx context.Context, issue *Issue, team *organizatio return team.UnitAccessMode(ctx, unit.TypeCode) >= perm.AccessModeWrite, nil } - return base.Int64sContains(pb.ApprovalsWhitelistTeamIDs, team.ID), nil + return slices.Contains(pb.ApprovalsWhitelistTeamIDs, team.ID), nil } // CreateReview creates a new review based on opts |