diff options
Diffstat (limited to 'pkg/bisect/bisect.go')
| -rw-r--r-- | pkg/bisect/bisect.go | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/pkg/bisect/bisect.go b/pkg/bisect/bisect.go index 73a1971c8..ba022e514 100644 --- a/pkg/bisect/bisect.go +++ b/pkg/bisect/bisect.go @@ -928,9 +928,7 @@ func (env *env) postTestResult(res *testResult) { // Let's be conservative and only decrease our reproduction likelihood estimate. // As the estimate of each test() can also be flaky, only partially update the result. avg := (env.reproChance + res.badRatio) / 2.0 - if env.reproChance > avg { - env.reproChance = avg - } + env.reproChance = min(env.reproChance, avg) } } @@ -1086,7 +1084,7 @@ func pickReleaseTags(all []string) []string { } var ret []string // Take 2 latest sub releases. - takeSubReleases := minInts(2, len(subReleases)) + takeSubReleases := min(2, len(subReleases)) ret = append(ret, subReleases[:takeSubReleases]...) // If there are a lot of sub releases, also take the middle one. if len(subReleases) > 5 { @@ -1107,13 +1105,3 @@ func pickReleaseTags(all []string) []string { } return ret } - -func minInts(vals ...int) int { - ret := vals[0] - for i := 1; i < len(vals); i++ { - if vals[i] < ret { - ret = vals[i] - } - } - return ret -} |
