]> Cypherpunks repositories - gostls13.git/commitdiff
math/bits: correct BenchmarkSub64
authorBrian Kessler <brian.m.kessler@gmail.com>
Wed, 24 Oct 2018 05:59:07 +0000 (23:59 -0600)
committerIan Lance Taylor <iant@golang.org>
Wed, 24 Oct 2018 14:53:19 +0000 (14:53 +0000)
Previously, the benchmark was measuring Add64 instead of Sub64.

Change-Id: I0cf30935c8a4728bead9868834377aae0b34f008
Reviewed-on: https://go-review.googlesource.com/c/144380
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/math/bits/bits_test.go

index bd6b618f3557d115ae78ff769c2d53177bb53e95..ede7c05d417a6c8e0727b0a120e13715d1229768 100644 (file)
@@ -918,7 +918,7 @@ func BenchmarkSub32(b *testing.B) {
 func BenchmarkSub64(b *testing.B) {
        var z, c uint64
        for i := 0; i < b.N; i++ {
-               z, c = Add64(uint64(Input), uint64(i), c)
+               z, c = Sub64(uint64(Input), uint64(i), c)
        }
        Output = int(z + c)
 }