forked from quic-go/quic-go
rename utils.Max to utils.MaxInt
This commit is contained in:
@@ -10,8 +10,8 @@ import (
|
||||
// InfDuration is a duration of infinite length
|
||||
const InfDuration = time.Duration(math.MaxInt64)
|
||||
|
||||
// Max returns the maximum of two Ints
|
||||
func Max(a, b int) int {
|
||||
// MaxInt returns the maximum of two Ints
|
||||
func MaxInt(a, b int) int {
|
||||
if a < b {
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
var _ = Describe("Min / Max", func() {
|
||||
Context("Max", func() {
|
||||
It("returns the maximum", func() {
|
||||
Expect(Max(5, 7)).To(Equal(7))
|
||||
Expect(Max(7, 5)).To(Equal(7))
|
||||
Expect(MaxInt(5, 7)).To(Equal(7))
|
||||
Expect(MaxInt(7, 5)).To(Equal(7))
|
||||
})
|
||||
|
||||
It("returns the maximum uint32", func() {
|
||||
|
||||
@@ -27,7 +27,7 @@ func (s *singleOriginTokenStore) Pop() *ClientToken {
|
||||
s.p = s.index(s.p - 1)
|
||||
token := s.tokens[s.p]
|
||||
s.tokens[s.p] = nil
|
||||
s.len = utils.Max(s.len-1, 0)
|
||||
s.len = utils.MaxInt(s.len-1, 0)
|
||||
return token
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user