Swich to the system min and max functions and remove the version from obiutils

Former-commit-id: 8c4558921b0d0c266b070f16e83813de6e6d4a0f
This commit is contained in:
Eric Coissac
2024-05-30 08:27:24 +02:00
parent 98b3bc2a8c
commit dd9307a4cd
12 changed files with 58 additions and 145 deletions

View File

@ -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")