commit | 96f3fb7244680fbb04549914384ced7afe433daf | [log] [tgz] |
---|---|---|
author | Matthew Dempsky <mdempsky@google.com> | Mon Nov 23 04:28:25 2020 -0800 |
committer | Matthew Dempsky <mdempsky@google.com> | Tue Nov 24 19:17:49 2020 +0000 |
tree | 5b3d5fcefb008787221f3cfb49787eda538bd45f | |
parent | 1abb12fc97d87ea67ce87a04ad6500bdfe1dbb7d [diff] |
[dev.regabi] go/constant: avoid heap allocations in match When type switching from interface{} to T, and then returning the T as interface{} again, it's better to return the original interface{} value. This avoids needing to heap allocate the T for non-pointer-shaped types (i.e., int64Val, complexVal, stringVal). Change-Id: I25c83b3f9ec9bd2ffeec5a65279b68f4fcef8a19 Reviewed-on: https://go-review.googlesource.com/c/go/+/272647 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Robert Griesemer <gri@golang.org>
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Official binary distributions are available at https://golang.org/dl/.
After downloading a binary release, visit https://golang.org/doc/install or load doc/install.html in your web browser for installation instructions.
If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source or load doc/install-source.html in your web browser for source installation instructions.
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.