aboutsummaryrefslogtreecommitdiff
path: root/src/internal/bytealg
diff options
context:
space:
mode:
authorMateusz Poliwczak <mpoliwczak34@gmail.com>2024-02-02 15:54:24 +0000
committerKeith Randall <khr@golang.org>2024-02-19 19:51:15 +0000
commit968b71bce4489dd201c5247c6142a830d90a1ee1 (patch)
treec9b44e6c18c8a2ca7910f804d786e569aabfc072 /src/internal/bytealg
parentcf52e709977d331a70df9463cf9e307024b6779f (diff)
downloadgo-968b71bce4489dd201c5247c6142a830d90a1ee1.tar.xz
strings: make use of sizeclasses in (*Builder).Grow
Fixes #64833 Change-Id: Ice3f5dfab65f5525bc7a6f57ddeaabda8d64dfa3 GitHub-Last-Rev: 38f1d6c19d8ec29ae5645ce677839a301f798df3 GitHub-Pull-Request: golang/go#64835 Reviewed-on: https://go-review.googlesource.com/c/go/+/552135 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/internal/bytealg')
-rw-r--r--src/internal/bytealg/bytealg.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/internal/bytealg/bytealg.go b/src/internal/bytealg/bytealg.go
index 1103891eee..6b79a2e1fa 100644
--- a/src/internal/bytealg/bytealg.go
+++ b/src/internal/bytealg/bytealg.go
@@ -111,7 +111,8 @@ func LastIndexRabinKarp[T string | []byte](s, sep T) int {
return -1
}
-// MakeNoZero makes a slice of length and capacity n without zeroing the bytes.
+// MakeNoZero makes a slice of length n and capacity of at least n Bytes
+// without zeroing the bytes (including the bytes between len and cap).
// It is the caller's responsibility to ensure uninitialized bytes
// do not leak to the end user.
func MakeNoZero(n int) []byte