]> Cypherpunks repositories - gostls13.git/commitdiff
[release-branch.go1] math/big: Remove unnecessary test from nat.go multiplication
authorDavid G. Andersen <dave.andersen@gmail.com>
Fri, 21 Sep 2012 19:53:57 +0000 (05:53 +1000)
committerRobert Griesemer <gri@golang.org>
Fri, 21 Sep 2012 19:53:57 +0000 (05:53 +1000)
««« backport c533f48701cb
math/big: Remove unnecessary test from nat.go multiplication
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 eaa6ff0666c7a90d48468ac435d6ada257a85d8b..6d81823bb4a503fc174e5cd618ebd373bdd2b2b7 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()