1
0
mirror of https://github.com/golang/go synced 2024-11-24 15:50:11 -07:00

cmd/compile: remove some unnecessary EType/int conversions

Change-Id: I2d8efef333f2441da6742e125e23ff57c9853ebd
Reviewed-on: https://go-review.googlesource.com/20078
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
This commit is contained in:
Matthew Dempsky 2016-02-29 20:07:09 -08:00
parent 55e7636f9c
commit a6c95ae1df

View File

@ -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
}