diff --git a/intersect.go b/intersect.go index cf6cab3d..520752b3 100644 --- a/intersect.go +++ b/intersect.go @@ -2,8 +2,8 @@ package lo // Contains returns true if an element is present in a collection. func Contains[T comparable](collection []T, element T) bool { - for _, item := range collection { - if item == element { + for i := range collection { + if collection[i] == element { return true } }