Skip to content

Commit

Permalink
rename utils.Min to utils.MinInt
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed Jul 25, 2022
1 parent b2c02cc commit 68aa87d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions internal/utils/minmax.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions internal/utils/minmax_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion token_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 68aa87d

Please sign in to comment.