Make ffmpeg skills compareable

This commit is contained in:
Ingo Oppermann
2023-07-06 10:27:56 +02:00
parent 604893f8bb
commit 6c2e8b0ec3
11 changed files with 489 additions and 77 deletions

28
slices/equal.go Normal file
View File

@@ -0,0 +1,28 @@
package slices
// EqualComparableElements returns whether two slices have the same elements.
func EqualComparableElements[T comparable](a, b []T) bool {
extraA, extraB := DiffComparable(a, b)
if len(extraA) == 0 && len(extraB) == 0 {
return true
}
return false
}
// Equaler defines a type that implements the Equal function.
type Equaler[T any] interface {
Equal(T) bool
}
// EqualEqualerElements returns whether two slices of Equaler have the same elements.
func EqualEqualerElements[T any, X Equaler[T]](a []T, b []X) bool {
extraA, extraB := DiffEqualer(a, b)
if len(extraA) == 0 && len(extraB) == 0 {
return true
}
return false
}