From a1fe84f88a85b1ed5fd7162acdbaf7831c07033c Mon Sep 17 00:00:00 2001 From: Anis Eleuch Date: Mon, 25 Mar 2024 12:06:52 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Klaus Post --- pkg/bench/get.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/bench/get.go b/pkg/bench/get.go index 1989064..f7d9ecb 100644 --- a/pkg/bench/get.go +++ b/pkg/bench/get.go @@ -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