From: Matthew Dempsky Date: Tue, 1 Mar 2016 04:07:09 +0000 (-0800) Subject: cmd/compile: remove some unnecessary EType/int conversions X-Git-Tag: go1.7beta1~1631 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=a6c95ae1df496acd05ef4302b23555baf228f137;p=gostls13.git cmd/compile: remove some unnecessary EType/int conversions Change-Id: I2d8efef333f2441da6742e125e23ff57c9853ebd Reviewed-on: https://go-review.googlesource.com/20078 Run-TryBot: Matthew Dempsky TryBot-Result: Gobot Gobot Reviewed-by: Dave Cheney --- diff --git a/src/cmd/compile/internal/gc/const.go b/src/cmd/compile/internal/gc/const.go index 795b53da11..6bcf9dddd3 100644 --- a/src/cmd/compile/internal/gc/const.go +++ b/src/cmd/compile/internal/gc/const.go @@ -185,12 +185,12 @@ func convlit1(np **Node, t *Type, explicit bool) { } ct := consttype(n) - var et int + var et EType if ct < 0 { goto bad } - et = int(t.Etype) + et = t.Etype if et == TINTER { if ct == CTNIL && n.Type == Types[TNIL] { n.Type = t @@ -241,7 +241,7 @@ func convlit1(np **Node, t *Type, explicit bool) { } case CTSTR, CTBOOL: - if et != int(n.Type.Etype) { + if et != n.Type.Etype { goto bad } @@ -587,7 +587,7 @@ func evconst(n *Node) { if consttype(nl) < 0 { return } - wl := int(nl.Type.Etype) + wl := nl.Type.Etype if Isint[wl] || Isfloat[wl] || Iscomplex[wl] { wl = TIDEAL } @@ -631,7 +631,7 @@ func evconst(n *Node) { nr := n.Right var rv Val var lno int - var wr int + var wr EType var v Val var norig *Node var nn *Node @@ -681,9 +681,9 @@ func evconst(n *Node) { case OCOM_ | CTINT_, OCOM_ | CTRUNE_: - et := Txxx + var et EType = Txxx if nl.Type != nil { - et = int(nl.Type.Etype) + et = nl.Type.Etype } // calculate the mask in b @@ -733,7 +733,7 @@ func evconst(n *Node) { if consttype(nr) < 0 { return } - wr = int(nr.Type.Etype) + wr = nr.Type.Etype if Isint[wr] || Isfloat[wr] || Iscomplex[wr] { wr = TIDEAL }