diff options
| author | Shulhan <m.shulhan@gmail.com> | 2023-05-02 01:06:11 +0700 |
|---|---|---|
| committer | Shulhan <m.shulhan@gmail.com> | 2024-01-25 04:01:14 +0700 |
| commit | 8096b47dd09fcda8712f7a3c07dced5244123a4d (patch) | |
| tree | 26339e20861f0d89cff1cf3dc763d7b99b4aaee8 /src/cmd/internal/edit/edit.go | |
| parent | 54386c4a7e68ab281545116220600f670e8f9e14 (diff) | |
| download | go-8096b47dd09fcda8712f7a3c07dced5244123a4d.tar.xz | |
all: prealloc slice with possible minimum capabilities
Diffstat (limited to 'src/cmd/internal/edit/edit.go')
| -rw-r--r-- | src/cmd/internal/edit/edit.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/internal/edit/edit.go b/src/cmd/internal/edit/edit.go index 2d470f4c8a..57c0820eb1 100644 --- a/src/cmd/internal/edit/edit.go +++ b/src/cmd/internal/edit/edit.go @@ -71,7 +71,7 @@ func (b *Buffer) Bytes() []byte { // to be applied before a replacement of the text at [x, y). sort.Stable(b.q) - var new []byte + new := make([]byte, 0, len(b.q)) offset := 0 for i, e := range b.q { if e.start < offset { |
