]> Cypherpunks repositories - gostls13.git/commitdiff
math/big: simplify bool expression
authorDaniel Martí <mvdan@mvdan.cc>
Tue, 14 Feb 2017 15:52:44 +0000 (15:52 +0000)
committerIan Lance Taylor <iant@golang.org>
Tue, 14 Feb 2017 23:34:25 +0000 (23:34 +0000)
Change-Id: I280c53be455f2fe0474ad577c0f7b7908a4eccb2
Reviewed-on: https://go-review.googlesource.com/36993
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/math/big/int.go

index bed8d60a5ed3b45ae4015e45fb91f6a9be0aa638..62f7fc53203d3642ad39a564a1b37c0e576a9734 100644 (file)
@@ -570,7 +570,7 @@ func (z *Int) binaryGCD(a, b *Int) *Int {
 // Rand sets z to a pseudo-random number in [0, n) and returns z.
 func (z *Int) Rand(rnd *rand.Rand, n *Int) *Int {
        z.neg = false
-       if n.neg == true || len(n.abs) == 0 {
+       if n.neg || len(n.abs) == 0 {
                z.abs = nil
                return z
        }