mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-04 12:52:28 +08:00
refactor: code improvement, ToString, Contain, Compact
This commit is contained in:
@@ -61,7 +61,6 @@ func Compact[T comparable](slice []T) []T {
|
||||
var zero T
|
||||
|
||||
result := []T{}
|
||||
|
||||
for _, item := range slice {
|
||||
if item != zero {
|
||||
result = append(result, item)
|
||||
|
||||
Reference in New Issue
Block a user