From c370d8407446bff825d38ffd973daa9948d9af2a Mon Sep 17 00:00:00 2001 From: Kunal Singh Date: Mon, 22 May 2023 10:18:22 +0530 Subject: [PATCH] [#2527] removed unnecessary slice check --- tools/list/list.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/list/list.go b/tools/list/list.go index 63909a29..9b0e40b5 100644 --- a/tools/list/list.go +++ b/tools/list/list.go @@ -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. func ExistInSlice[T comparable](item T, list []T) bool { - if len(list) == 0 { - return false - } for _, v := range list { if v == item {