| commit | 73f92f9b0405e98427bbb445f24cffb5d3c4d01b | [log] [tgz] |
|---|---|---|
| author | Keith Randall <khr@golang.org> | Sun Nov 27 11:43:08 2016 -0800 |
| committer | Keith Randall <khr@golang.org> | Thu Feb 02 17:45:58 2017 +0000 |
| tree | 05df0d7b52dc6316d6b939d8d817b2f91e8d4595 | |
| parent | 6317f92f6e51f679712deec6094c6b5fc2948a5b [diff] |
cmd/compile: use len(s)<=cap(s) to remove more bounds checks When we discover a relation x <= len(s), also discover the relation x <= cap(s). That way, in situations like: a := s[x:] // tests 0 <= x <= len(s) b := s[:x] // tests 0 <= x <= cap(s) the second check can be eliminated. Fixes #16813 Change-Id: Ifc037920b6955e43bac1a1eaf6bac63a89cfbd44 Reviewed-on: https://go-review.googlesource.com/33633 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alexandru Moșoi <alexandru@mosoi.ro> Reviewed-by: David Chase <drchase@google.com>
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
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 hundreds of contributors. We appreciate your help!
To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html
Note that the Go project does not use GitHub pull requests, and that we use 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.