Clash.Meta/transport/tuic/congestion/minmax_go120.go
Larvan2 fa49fd7ba2 chore: use cmp in go 1.21
Co-authored-by: H1JK <hell0jack@protonmail.com>
2023-09-16 12:06:58 +08:00

20 lines
244 B
Go

//go:build !go1.21
package congestion
import "golang.org/x/exp/constraints"
func Max[T constraints.Ordered](a, b T) T {
if a < b {
return b
}
return a
}
func Min[T constraints.Ordered](a, b T) T {
if a < b {
return a
}
return b
}