diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2025-01-17 10:28:16 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2025-01-17 10:02:07 +0000 |
| commit | 5d04aae8969f6c72318ce0a4cde4f027766b1a55 (patch) | |
| tree | 8f1b632847c431407090f0fe1335522ff2195a37 /pkg/bisect/minimize | |
| parent | f9e07a6e597b68d3397864e6ee4550f9065c3518 (diff) | |
all: use min/max functions
They are shorter, more readable, and don't require temp vars.
Diffstat (limited to 'pkg/bisect/minimize')
| -rw-r--r-- | pkg/bisect/minimize/slice.go | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/pkg/bisect/minimize/slice.go b/pkg/bisect/minimize/slice.go index fee125542..d5fbc6c6a 100644 --- a/pkg/bisect/minimize/slice.go +++ b/pkg/bisect/minimize/slice.go @@ -257,10 +257,7 @@ func splitChunk[T any](chunk []T, parts int) [][]T { } var ret [][]T for i := 0; i < len(chunk); i += chunkSize { - end := i + chunkSize - if end > len(chunk) { - end = len(chunk) - } + end := min(i+chunkSize, len(chunk)) ret = append(ret, chunk[i:end]) } return ret |
