From f3999888c0b765380003f814f9c3d5cf80128167 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Thu, 28 Dec 2023 17:38:59 +0800 Subject: 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 --- models/issues/review.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'models/issues/review.go') 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 -- cgit v1.2.3