Skip to content

Commit 25012bf

Browse files
committed
Describe the impact of using NewBufferFromByteSlice and Resize together.
1 parent 924fb33 commit 25012bf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

buffer.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,9 @@ func (buf Buffer) String() string {
118118
// fix the MSBs or the LSBs.
119119
//
120120
// Resize always reallocates internal memory. That is, the buffers created by
121-
// Slice method break their relationship with the parent buffer by calling this
122-
// Resize, even if nBits is equivalent to its current size.
121+
// Slice method or NewBufferFromByteSlice break their relationship with the
122+
// parent buffer or slice by calling this Resize, even if nBits is equivalent to
123+
// or less than its current size.
123124
func (buf *Buffer) Resize(nBits int, align Alignment) {
124125
switch {
125126
case nBits < 0:

0 commit comments

Comments
 (0)