Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c7a3ca6

Browse files
egonelbreStorj Robot
authored andcommitted
all: remove custom min and max
Change-Id: I4bfae1e6dc49288bbf489e314c9c63360dc5666a
1 parent 230327e commit c7a3ca6

File tree

4 files changed

+0
-29
lines changed

4 files changed

+0
-29
lines changed

cmd/storj-sim/prefix.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,6 @@ const (
2828
emptyTimeField = " "
2929
)
3030

31-
func max(a, b int) int {
32-
if a > b {
33-
return a
34-
}
35-
return b
36-
}
37-
3831
// NewPrefixWriter creates a writer than can prefix all lines written to it.
3932
func NewPrefixWriter(defaultPrefix string, maxLineLen int, dst io.Writer) *PrefixWriter {
4033
writer := &PrefixWriter{

satellite/metabase/rangedloop/rangedlooptest/provider.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,6 @@ func (m *SegmentProvider) Iterate(ctx context.Context, fn func([]rangedloop.Segm
6767
return nil
6868
}
6969

70-
func min(x, y int) int {
71-
if x < y {
72-
return x
73-
}
74-
return y
75-
}
76-
7770
func streamsFromSegments(segments []rangedloop.Segment) [][]rangedloop.Segment {
7871
// Duplicate and sort the segments by stream ID
7972
segments = append([]rangedloop.Segment(nil), segments...)

satellite/metainfo/bloomrate/rate.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,3 @@ func (r *Rate) Allow(now time.Time, limit rate.Limit, burst int) bool {
7575
(*atomic.Uint64)(r).Store(uint64(tokens-2) | ((uint64(expiry.UnixNano()) << 1) & timeMask))
7676
return true
7777
}
78-
79-
func min(x, y int) int {
80-
if x < y {
81-
return x
82-
}
83-
return y
84-
}

storagenode/piecestore/endpoint.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,14 +1045,6 @@ func (endpoint *Endpoint) TestLiveRequestCount() int32 {
10451045
return atomic.LoadInt32(&endpoint.liveRequests)
10461046
}
10471047

1048-
// min finds the min of two values.
1049-
func min(a, b int64) int64 {
1050-
if a < b {
1051-
return a
1052-
}
1053-
return b
1054-
}
1055-
10561048
// speedEstimation monitors state of incoming traffic. It would signal slow-speed
10571049
// client in non-congested traffic condition.
10581050
type speedEstimation struct {

0 commit comments

Comments
 (0)