mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 20:27:35 +03:00
rename utils.Min to utils.MinInt
This commit is contained in:
parent
2ea21b7b16
commit
424325af58
3 changed files with 5 additions and 5 deletions
|
@ -42,8 +42,8 @@ func MinUint64(a, b uint64) uint64 {
|
|||
return b
|
||||
}
|
||||
|
||||
// Min returns the minimum of two Ints
|
||||
func Min(a, b int) int {
|
||||
// MinInt returns the minimum of two Ints
|
||||
func MinInt(a, b int) int {
|
||||
if a < b {
|
||||
return a
|
||||
}
|
||||
|
|
|
@ -65,8 +65,8 @@ var _ = Describe("Min / Max", func() {
|
|||
|
||||
Context("Min", func() {
|
||||
It("returns the minimum", func() {
|
||||
Expect(Min(5, 7)).To(Equal(5))
|
||||
Expect(Min(7, 5)).To(Equal(5))
|
||||
Expect(MinInt(5, 7)).To(Equal(5))
|
||||
Expect(MinInt(7, 5)).To(Equal(5))
|
||||
})
|
||||
|
||||
It("returns the minimum uint32", func() {
|
||||
|
|
|
@ -20,7 +20,7 @@ func newSingleOriginTokenStore(size int) *singleOriginTokenStore {
|
|||
func (s *singleOriginTokenStore) Add(token *ClientToken) {
|
||||
s.tokens[s.p] = token
|
||||
s.p = s.index(s.p + 1)
|
||||
s.len = utils.Min(s.len+1, len(s.tokens))
|
||||
s.len = utils.MinInt(s.len+1, len(s.tokens))
|
||||
}
|
||||
|
||||
func (s *singleOriginTokenStore) Pop() *ClientToken {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue