Skip to content

Commit

Permalink
Merge pull request #244 from zhiqiangxu/minor_opt_GetRandomPositiveInt
Browse files Browse the repository at this point in the history
[nit] remove unnecessary cmp
  • Loading branch information
ZhAnGeek authored Jan 11, 2024
2 parents c8136c9 + 773b6af commit 8a87b22
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/random.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func GetRandomPositiveInt(lessThan *big.Int) *big.Int {
var try *big.Int
for {
try = MustGetRandomInt(lessThan.BitLen())
if try.Cmp(lessThan) < 0 && try.Cmp(zero) >= 0 {
if try.Cmp(lessThan) < 0 {
break
}
}
Expand Down

0 comments on commit 8a87b22

Please sign in to comment.