]> Cypherpunks repositories - gostls13.git/commitdiff
go/types, types2: remove unnecessary assignment (minor cleanup)
authorRobert Griesemer <gri@golang.org>
Thu, 18 May 2023 18:40:19 +0000 (11:40 -0700)
committerGopher Robot <gobot@golang.org>
Thu, 18 May 2023 22:02:20 +0000 (22:02 +0000)
Change-Id: I77e5056a159b6041ca49480a3c493a515d4b3a2f
Reviewed-on: https://go-review.googlesource.com/c/go/+/496255
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/cmd/compile/internal/types2/builtins.go
src/go/types/builtins.go

index 1a79fc8ebd9fb4bd962ef11370382759b77ef1e2..e8c0859fa0325f27a642cd5aec202224ae49329d 100644 (file)
@@ -636,12 +636,11 @@ func (check *Checker) builtin(x *operand, call *syntax.CallExpr, id builtinId) (
                if nargs > 0 {
                        params = make([]Type, nargs)
                        for i, a := range args {
-                               *x = *a
-                               check.assignment(x, nil, "argument to "+predeclaredFuncs[id].name)
-                               if x.mode == invalid {
+                               check.assignment(a, nil, "argument to "+predeclaredFuncs[id].name)
+                               if a.mode == invalid {
                                        return
                                }
-                               params[i] = x.typ
+                               params[i] = a.typ
                        }
                }
 
index 80cfeb3880c767b8fa968c12a67aae3edda09c09..d40d8d77cc375334742325a7a344f0a3f830c2a2 100644 (file)
@@ -635,12 +635,11 @@ func (check *Checker) builtin(x *operand, call *ast.CallExpr, id builtinId) (_ b
                if nargs > 0 {
                        params = make([]Type, nargs)
                        for i, a := range args {
-                               *x = *a
-                               check.assignment(x, nil, "argument to "+predeclaredFuncs[id].name)
-                               if x.mode == invalid {
+                               check.assignment(a, nil, "argument to "+predeclaredFuncs[id].name)
+                               if a.mode == invalid {
                                        return
                                }
-                               params[i] = x.typ
+                               params[i] = a.typ
                        }
                }