@@ -342,7 +342,7 @@ func IsProtectedBranch(ctx context.Context, repoID int64, branchName string) (bo
342342// updateApprovalWhitelist checks whether the user whitelist changed and returns a whitelist with
343343// the users from newWhitelist which have explicit read or write access to the repo.
344344func updateApprovalWhitelist (ctx context.Context , repo * repo_model.Repository , currentWhitelist , newWhitelist []int64 ) (whitelist []int64 , err error ) {
345- hasUsersChanged := ! util .IsSliceInt64Eq (currentWhitelist , newWhitelist )
345+ hasUsersChanged := ! util .SliceSortedEqual (currentWhitelist , newWhitelist )
346346 if ! hasUsersChanged {
347347 return currentWhitelist , nil
348348 }
@@ -363,7 +363,7 @@ func updateApprovalWhitelist(ctx context.Context, repo *repo_model.Repository, c
363363// updateUserWhitelist checks whether the user whitelist changed and returns a whitelist with
364364// the users from newWhitelist which have write access to the repo.
365365func updateUserWhitelist (ctx context.Context , repo * repo_model.Repository , currentWhitelist , newWhitelist []int64 ) (whitelist []int64 , err error ) {
366- hasUsersChanged := ! util .IsSliceInt64Eq (currentWhitelist , newWhitelist )
366+ hasUsersChanged := ! util .SliceSortedEqual (currentWhitelist , newWhitelist )
367367 if ! hasUsersChanged {
368368 return currentWhitelist , nil
369369 }
@@ -392,7 +392,7 @@ func updateUserWhitelist(ctx context.Context, repo *repo_model.Repository, curre
392392// updateTeamWhitelist checks whether the team whitelist changed and returns a whitelist with
393393// the teams from newWhitelist which have write access to the repo.
394394func updateTeamWhitelist (ctx context.Context , repo * repo_model.Repository , currentWhitelist , newWhitelist []int64 ) (whitelist []int64 , err error ) {
395- hasTeamsChanged := ! util .IsSliceInt64Eq (currentWhitelist , newWhitelist )
395+ hasTeamsChanged := ! util .SliceSortedEqual (currentWhitelist , newWhitelist )
396396 if ! hasTeamsChanged {
397397 return currentWhitelist , nil
398398 }
@@ -404,7 +404,7 @@ func updateTeamWhitelist(ctx context.Context, repo *repo_model.Repository, curre
404404
405405 whitelist = make ([]int64 , 0 , len (teams ))
406406 for i := range teams {
407- if util .IsInt64InSlice ( teams [i ].ID , newWhitelist ) {
407+ if util .SliceContains ( newWhitelist , teams [i ].ID ) {
408408 whitelist = append (whitelist , teams [i ].ID )
409409 }
410410 }
0 commit comments