summaryrefslogtreecommitdiff
path: root/src/lib/io/bytebuffer.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/io/bytebuffer.go')
-rw-r--r--src/lib/io/bytebuffer.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/lib/io/bytebuffer.go b/src/lib/io/bytebuffer.go
index 88371c4b7..bc6a73741 100644
--- a/src/lib/io/bytebuffer.go
+++ b/src/lib/io/bytebuffer.go
@@ -39,8 +39,7 @@ func (b *ByteBuffer) Len() int {
return len(b.buf) - b.off
}
-// Truncates the buffer so it contains n bytes.
-// It preserves the data in the buffer at positions [0 : n].
+// Truncate discards all but the first n unread bytes from the buffer.
// It is an error to call b.Truncate(n) with n > b.Len().
func (b *ByteBuffer) Truncate(n int) {
b.buf = b.buf[0 : b.off + n];