File tree Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -46,5 +46,5 @@ func TestCachePutWithOnEvict(t *testing.T) {
46
46
47
47
cachetest .Basic (t , c )
48
48
require .Len (t , evicted , 1 )
49
- require .Equal (t , evicted [ids.ID {1 }], int64 ( 1 ) )
49
+ require .Equal (t , int64 ( 1 ), evicted [ids.ID {1 }])
50
50
}
Original file line number Diff line number Diff line change @@ -1030,10 +1030,7 @@ func (m *Manager) enqueueWork(work *workItem) {
1030
1030
func midPoint (startMaybe , endMaybe maybe.Maybe [[]byte ]) maybe.Maybe [[]byte ] {
1031
1031
start := startMaybe .Value ()
1032
1032
end := endMaybe .Value ()
1033
- length := len (start )
1034
- if len (end ) > length {
1035
- length = len (end )
1036
- }
1033
+ length := max (len (end ), len (start ))
1037
1034
1038
1035
if length == 0 {
1039
1036
if endMaybe .IsNothing () {
@@ -1180,10 +1177,8 @@ func calculateBackoff(attempt int) time.Duration {
1180
1177
return 0
1181
1178
}
1182
1179
1183
- retryWait := initialRetryWait * time .Duration (math .Pow (retryWaitFactor , float64 (attempt )))
1184
- if retryWait > maxRetryWait {
1185
- retryWait = maxRetryWait
1186
- }
1187
-
1188
- return retryWait
1180
+ return min (
1181
+ initialRetryWait * time .Duration (math .Pow (retryWaitFactor , float64 (attempt ))),
1182
+ maxRetryWait ,
1183
+ )
1189
1184
}
You can’t perform that action at this time.
0 commit comments