Skip to content

Commit

Permalink
Refactoring array contains function
Browse files Browse the repository at this point in the history
Signed-off-by: Gaurav Jaswal <[email protected]>
  • Loading branch information
jaswalkiranavtar committed Jan 9, 2025
1 parent 22a64b5 commit cb0df69
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"
"k8s.io/apimachinery/pkg/util/rand"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/client-go/tools/clientcmd"

commonoptions "open-cluster-management.io/ocm/pkg/common/options"
Expand Down Expand Up @@ -170,10 +171,6 @@ var _ = ginkgo.Describe("Joining Process for aws flow", func() {
})

func contains(slice []string, value string) bool {
for _, item := range slice {
if item == value {
return true
}
}
return false
stringSet := sets.New[string](slice...)
return stringSet.Has(value)
}

0 comments on commit cb0df69

Please sign in to comment.