aboutsummaryrefslogtreecommitdiff
path: root/src/archive/zip
diff options
context:
space:
mode:
authorShulhan <m.shulhan@gmail.com>2024-10-26 00:48:33 +0700
committerShulhan <m.shulhan@gmail.com>2026-02-03 18:04:30 +0700
commit011e40da85bddf83fee0ded83cb9115b7a88b3d4 (patch)
tree355cc352e66fc64ce94f17658c31e699aa798bb1 /src/archive/zip
parent85232e51b20971e0d211b25fa3aa412bc7987404 (diff)
downloadgo-011e40da85bddf83fee0ded83cb9115b7a88b3d4.tar.xz
all: prealloc slice with possible minimum capabilities
Diffstat (limited to 'src/archive/zip')
-rw-r--r--src/archive/zip/zip_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/archive/zip/zip_test.go b/src/archive/zip/zip_test.go
index 5a6689a0eb..e891d26c10 100644
--- a/src/archive/zip/zip_test.go
+++ b/src/archive/zip/zip_test.go
@@ -240,8 +240,8 @@ func (r *rleBuffer) ReadAt(p []byte, off int64) (n int, err error) {
// Just testing the rleBuffer used in the Zip64 test above. Not used by the zip code.
func TestRLEBuffer(t *testing.T) {
b := new(rleBuffer)
- var all []byte
writes := []string{"abcdeee", "eeeeeee", "eeeefghaaiii"}
+ all := make([]byte, 0, len(writes)*len(writes[0]))
for _, w := range writes {
b.Write([]byte(w))
all = append(all, w...)