Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Klaus Post <[email protected]>
  • Loading branch information
vadmeste and klauspost authored Mar 25, 2024
1 parent 7433744 commit a1fe84f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/bench/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,13 @@ func (g *Get) Start(ctx context.Context, wait chan struct{}) (Operations, error)

if g.RandomRanges && op.Size > 2 {
var start, end int64
if g.RangeSize == 0 {
if g.RangeSize <= 0 {
// Randomize length similar to --obj.randsize
size := generator.GetExpRandSize(rng, 0, op.Size-2)
start = rng.Int63n(op.Size - size)
end = start + size
} else {
start = g.RangeSize * rng.Int63n(op.Size/g.RangeSize)
start = rng.Int63n(op.Size - g.RangeSize)
end = start + g.RangeSize - 1
}
op.Size = end - start + 1
Expand Down

0 comments on commit a1fe84f

Please sign in to comment.