Skip to content

Commit

Permalink
fix: Fix infinite random seq set interval loop
Browse files Browse the repository at this point in the history
If the `start` was equal to `max-1` we would never exit the loop.
  • Loading branch information
LBeernaertProton committed Sep 21, 2022
1 parent 5ded977 commit 3a05bd1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions benchmarks/gluon_bench/imap_benchmarks/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,10 @@ func RandomSequenceSetRange(max uint32) *imap.SeqSet {
}

stop := start
for stop <= start {
stop = rand.Uint32() % max
if start != max-1 {
for stop <= start {
stop = rand.Uint32() % max
}
}

r := &imap.SeqSet{}
Expand Down

0 comments on commit 3a05bd1

Please sign in to comment.