]> Cypherpunks repositories - gostls13.git/commitdiff
strconv: Removed unnecessary use of goto. Made code easier to read.
authorRobin Eklind <r.eklind.87@gmail.com>
Wed, 14 Nov 2012 17:42:48 +0000 (09:42 -0800)
committerRobert Griesemer <gri@golang.org>
Wed, 14 Nov 2012 17:42:48 +0000 (09:42 -0800)
R=gri
CC=gobot, golang-dev
https://golang.org/cl/6855048

src/pkg/strconv/extfloat.go

index 438017e5f66af8851b906287aa28ff83f76eb73e..b7eaaa61bf4d92016c62a3fe4c4cd3bf6bb7da79 100644 (file)
@@ -152,22 +152,14 @@ func (f *extFloat) floatBits(flt *floatInfo) (bits uint64, overflow bool) {
 
        // Infinities.
        if exp-flt.bias >= 1<<flt.expbits-1 {
-               goto overflow
-       }
-
-       // Denormalized?
-       if mant&(1<<flt.mantbits) == 0 {
+               // ±Inf
+               mant = 0
+               exp = 1<<flt.expbits - 1 + flt.bias
+               overflow = true
+       } else if mant&(1<<flt.mantbits) == 0 {
+               // Denormalized?
                exp = flt.bias
        }
-       goto out
-
-overflow:
-       // ±Inf
-       mant = 0
-       exp = 1<<flt.expbits - 1 + flt.bias
-       overflow = true
-
-out:
        // Assemble bits.
        bits = mant & (uint64(1)<<flt.mantbits - 1)
        bits |= uint64((exp-flt.bias)&(1<<flt.expbits-1)) << flt.mantbits