]> Cypherpunks repositories - gostls13.git/commitdiff
math,net: omit explicit true tag expr in switch
authorIskander Sharipov <iskander.sharipov@intel.com>
Wed, 11 Jul 2018 20:42:40 +0000 (23:42 +0300)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 20 Aug 2018 22:15:59 +0000 (22:15 +0000)
Performed `switch true {}` => `switch {}` replacement.

Found using https://go-critic.github.io/overview.html#switchTrue-ref

Change-Id: Ib39ea98531651966a5a56b7bd729b46e4eeb7f7c
Reviewed-on: https://go-review.googlesource.com/123378
Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/math/sinh.go
src/net/ip.go

index 39e7c2047a9ec4b2e08da06a64619280bef01c26..573a37e35fa2a2c4ad0362b89448fdba62d174cb 100644 (file)
@@ -43,7 +43,7 @@ func sinh(x float64) float64 {
        }
 
        var temp float64
-       switch true {
+       switch {
        case x > 21:
                temp = Exp(x) * 0.5
 
index da8dca588e5c80209a080f7ef750ec1050d7940b..410de92ccc2dc6ce6f693d676c0068bf5b5f7bf8 100644 (file)
@@ -222,7 +222,7 @@ func (ip IP) DefaultMask() IPMask {
        if ip = ip.To4(); ip == nil {
                return nil
        }
-       switch true {
+       switch {
        case ip[0] < 0x80:
                return classAMask
        case ip[0] < 0xC0: