aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--misc/random_bugs/create_random_bugs.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/misc/random_bugs/create_random_bugs.go b/misc/random_bugs/create_random_bugs.go
index f2d7e7c3..14c2b26f 100644
--- a/misc/random_bugs/create_random_bugs.go
+++ b/misc/random_bugs/create_random_bugs.go
@@ -72,7 +72,12 @@ func GenerateRandomBugsWithSeed(opts Options, seed int64) []*bug.Bug {
panic(err)
}
- nOps := opts.MinOp + rand.Intn(opts.MaxOp-opts.MinOp)
+ nOps := opts.MinOp
+
+ if opts.MaxOp > opts.MinOp {
+ nOps += rand.Intn(opts.MaxOp - opts.MinOp)
+ }
+
for j := 0; j < nOps; j++ {
index := rand.Intn(len(opsGenerators))
opsGenerators[index](b, randomPerson(opts.PersonNumber))