Fix buffer

Will be merged into f0be1a9e
This commit is contained in:
世界 2023-12-08 18:06:50 +08:00
parent 0f7de716ac
commit c7ef05a85b
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
2 changed files with 9 additions and 10 deletions

View file

@ -331,6 +331,10 @@ func (b *Buffer) Len() int {
}
func (b *Buffer) Cap() int {
return b.capacity
}
func (b *Buffer) RawCap() int {
return len(b.data)
}
@ -338,10 +342,6 @@ func (b *Buffer) Bytes() []byte {
return b.data[b.start:b.end]
}
func (b *Buffer) Slice() []byte {
return b.data[:b.capacity]
}
func (b *Buffer) From(n int) []byte {
return b.data[b.start+n : b.end]
}