Clash.Meta/transport/tuic/congestion_v2/minmax_go120.go

20 lines
244 B
Go
Raw Normal View History

2023-09-30 23:55:56 +08:00
//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
}