From 793187d85d00273f1667108d842032809a4ee0e4 Mon Sep 17 00:00:00 2001 From: leaxoy Date: Mon, 3 Jul 2023 02:02:16 +0800 Subject: [PATCH] fix(slices): FilterNonZero --- slices/slice.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slices/slice.go b/slices/slice.go index 9302b89..913bb64 100644 --- a/slices/slice.go +++ b/slices/slice.go @@ -428,7 +428,7 @@ func SpliceLast[T any](slice []T) (optional.Optional[T], []T) { // chan/map/slice: nil func FilterNonZero[T comparable](slice []T) []T { var empty T - return Filter(slice, func(t T) bool { return t == empty }) + return Filter(slice, func(t T) bool { return t != empty }) } func FirstNonZero[T comparable](slice []T) T {