mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
Swich to the system min and max functions and remove the version from obiutils
Former-commit-id: 8c4558921b0d0c266b070f16e83813de6e6d4a0f
This commit is contained in:
@ -4,20 +4,6 @@ import (
|
||||
"golang.org/x/exp/constraints"
|
||||
)
|
||||
|
||||
func Min[T constraints.Ordered](x, y T) T {
|
||||
if x < y {
|
||||
return x
|
||||
}
|
||||
return y
|
||||
}
|
||||
|
||||
func Max[T constraints.Ordered](x, y T) T {
|
||||
if x < y {
|
||||
return y
|
||||
}
|
||||
return x
|
||||
}
|
||||
|
||||
func MinMax[T constraints.Ordered](x, y T) (T, T) {
|
||||
if x < y {
|
||||
return x, y
|
||||
@ -25,7 +11,6 @@ func MinMax[T constraints.Ordered](x, y T) (T, T) {
|
||||
return y, x
|
||||
}
|
||||
|
||||
|
||||
func MinMaxSlice[T constraints.Ordered](vec []T) (min, max T) {
|
||||
if len(vec) == 0 {
|
||||
panic("empty slice")
|
||||
|
Reference in New Issue
Block a user