-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gopls/internal/analysis/modernize: appendclipped: unclip
The appendclipped pass must ascertain that the first argument to append(x, y...) is clipped, so that we don't eliminate possible intended side effects on x, but in some cases: - append(x[:len(x):len(x)], y...) - append(slices.Clip(x), y...) we can further simplify the first argument to its unclipped version (just x in both cases), so that the result is: slices.Concat(x, y) + test Fixes golang/go#71296 Change-Id: I89cc4350b5dbd57c88c35c0b4459b23347814441 Reviewed-on: https://go-review.googlesource.com/c/tools/+/647796 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Findley <rfindley@google.com>
- Loading branch information
Showing
3 changed files
with
34 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters