From fcca9d265c871863392d821723a9a4ddd29ac2ba Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Sat, 26 Mar 2016 11:20:20 -0700 Subject: [PATCH] cmd/compile: remove pointless conversions in copytype Passes toolstash -cmp. Change-Id: I8b000d4e90e6aa1a0e60bd46fb7cba2ddc1774b5 Reviewed-on: https://go-review.googlesource.com/21210 Run-TryBot: Josh Bleecher Snyder Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/cmd/compile/internal/gc/typecheck.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/cmd/compile/internal/gc/typecheck.go b/src/cmd/compile/internal/gc/typecheck.go index e364d56b4f6..ee7c34c8956 100644 --- a/src/cmd/compile/internal/gc/typecheck.go +++ b/src/cmd/compile/internal/gc/typecheck.go @@ -3504,12 +3504,11 @@ func copytype(n *Node, t *Type) { if t.Etype == TFORW { // This type isn't computed yet; when it is, update n. t.Copyto = append(t.Copyto, n) - return } - maplineno := int(n.Type.Maplineno) - embedlineno := int(n.Type.Embedlineno) + maplineno := n.Type.Maplineno + embedlineno := n.Type.Embedlineno l := n.Type.Copyto // TODO(mdempsky): Fix Type rekinding. @@ -3537,7 +3536,7 @@ func copytype(n *Node, t *Type) { lno := lineno if embedlineno != 0 { - lineno = int32(embedlineno) + lineno = embedlineno if Isptr[t.Etype] { Yyerror("embedded type cannot be a pointer") } @@ -3547,7 +3546,7 @@ func copytype(n *Node, t *Type) { // Queue check for map until all the types are done settling. if maplineno != 0 { - t.Maplineno = int32(maplineno) + t.Maplineno = maplineno mapqueue = append(mapqueue, n) } }