v0.0.456
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 2m38s
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 2m38s
This commit is contained in:
@@ -59,6 +59,18 @@ func ArrUnique[T comparable](array []T) []T {
|
||||
return result
|
||||
}
|
||||
|
||||
func ArrUniqueStable[T comparable](array []T) []T {
|
||||
hist := make(map[T]bool, len(array))
|
||||
result := make([]T, 0, len(array))
|
||||
for _, v := range array {
|
||||
if _, ok := hist[v]; !ok {
|
||||
hist[v] = true
|
||||
result = append(result, v)
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func ArrEqualsExact[T comparable](arr1 []T, arr2 []T) bool {
|
||||
if len(arr1) != len(arr2) {
|
||||
return false
|
||||
|
Reference in New Issue
Block a user