commit | 80a7f6dae0861a06407a44c501b6346a4abd119c | [log] [tgz] |
---|---|---|
author | Cherry Zhang <cherryyz@google.com> | Sat Mar 09 00:38:38 2019 -0500 |
committer | Ian Lance Taylor <iant@golang.org> | Fri Mar 15 04:34:03 2019 +0000 |
tree | aace70c4ff8aea807ecb65dcda5e91729730ee4b | |
parent | 946aa5ab2e82d045a2a3b2f18ba2c5b00e957c4b [diff] |
compiler: eliminate bound checks in append expression The compiler generates two array index expressions when lowering an append expression. Currently they generate bound checks. Bound checks are not necessary in this case, as we know the slice has, or will grow to, enough length and capacity. Eliminate them. Change-Id: I6d29cf0b29e0561a2f8fc14f958c29129bf30a0e Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/166817 Reviewed-by: Ian Lance Taylor <iant@golang.org>