aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/edit
diff options
context:
space:
mode:
authorShulhan <m.shulhan@gmail.com>2024-10-26 00:48:33 +0700
committerShulhan <m.shulhan@gmail.com>2026-04-14 21:51:40 +0700
commit8c0027ca7bde882aaa063044ac7c64ba5c7a6c92 (patch)
tree3180813916ed48f0cd2c22a97561cf988f636e91 /src/cmd/internal/edit
parent66e8a77e30babe052c023320d85af4c126413da8 (diff)
downloadgo-8c0027ca7bde882aaa063044ac7c64ba5c7a6c92.tar.xz
all: prealloc slice with possible minimum capabilities
Diffstat (limited to 'src/cmd/internal/edit')
-rw-r--r--src/cmd/internal/edit/edit.go2
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 {