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:
parent
ce7837b9ef
commit
70106733d9
@ -1,5 +1,5 @@
|
||||
package goext
|
||||
|
||||
const GoextVersion = "0.0.455"
|
||||
const GoextVersion = "0.0.456"
|
||||
|
||||
const GoextVersionTimestamp = "2024-05-16T15:38:42+0200"
|
||||
const GoextVersionTimestamp = "2024-05-18T23:38:47+0200"
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user