]> Cypherpunks repositories - gostls13.git/commit
slices: avoid an unnecessary check in Replace
authorgo101 <tapir.liu@gmail.com>
Wed, 18 Oct 2023 17:17:18 +0000 (17:17 +0000)
committerGopher Robot <gobot@golang.org>
Thu, 19 Oct 2023 00:48:21 +0000 (00:48 +0000)
commitf3a2459caa2bd360fee782de8cf8d4de724a7316
tree244de5e9980d95023e78cbed2c0f89498751611d
parent1c5862cc0afada6ef0c07687ce4bf951ed9dd798
slices: avoid an unnecessary check in Replace

The current implementation of the builtin copy function will return early
when it is found that the addresses of the first elements of the two
slice arguments are identical, so it is unnecessarily to do this in user code.

See #57759 for details.

Change-Id: I7c101eee496923d7aa59f94720da6c84feb93af8
GitHub-Last-Rev: 4d6819fb25143f5ad3ff65eca7fe6094c37f2af2
GitHub-Pull-Request: golang/go#63617
Reviewed-on: https://go-review.googlesource.com/c/go/+/536255
Auto-Submit: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Keith Randall <khr@google.com>
src/slices/slices.go