chore: add new bbr implementation
This commit is contained in:
19
transport/tuic/congestion_v2/minmax_go120.go
Normal file
19
transport/tuic/congestion_v2/minmax_go120.go
Normal file
@ -0,0 +1,19 @@
|
||||
//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
|
||||
}
|
Reference in New Issue
Block a user