]> Cypherpunks repositories - gostls13.git/commitdiff
math/big: Remove unnecessary test from nat.go multiplication
authorDavid G. Andersen <dave.andersen@gmail.com>
Mon, 2 Jul 2012 22:30:00 +0000 (15:30 -0700)
committerRobert Griesemer <gri@golang.org>
Mon, 2 Jul 2012 22:30:00 +0000 (15:30 -0700)
The switch at the beginning of the function already ensures n > 1,
so testing for n < 2 is redundant.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/6350051

src/pkg/math/big/nat.go

index f132507dfd22bb621eda434ba5e17b399a6beb3b..66f14b4ee7526b7d966e686ce7f062478ab06447 100644 (file)
@@ -396,7 +396,7 @@ func (z nat) mul(x, y nat) nat {
        }
 
        // use basic multiplication if the numbers are small
-       if n < karatsubaThreshold || n < 2 {
+       if n < karatsubaThreshold {
                z = z.make(m + n)
                basicMul(z, x, y)
                return z.norm()