[#2527] removed unnecessary slice check
This commit is contained in:
parent
4f5aa6ffda
commit
c370d84074
|
@ -27,9 +27,6 @@ func SubtractSlice[T comparable](base []T, subtract []T) []T {
|
||||||
|
|
||||||
// ExistInSlice checks whether a comparable element exists in a slice of the same type.
|
// ExistInSlice checks whether a comparable element exists in a slice of the same type.
|
||||||
func ExistInSlice[T comparable](item T, list []T) bool {
|
func ExistInSlice[T comparable](item T, list []T) bool {
|
||||||
if len(list) == 0 {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, v := range list {
|
for _, v := range list {
|
||||||
if v == item {
|
if v == item {
|
||||||
|
|
Loading…
Reference in New Issue