encoding: it is no longer intended that Buffer/RawPacket would be pooled, the byte slices should be

This commit is contained in:
Cassondra Foesch 2021-03-22 12:22:56 +00:00
parent ae26d72513
commit caecc84def
2 changed files with 0 additions and 12 deletions

View File

@ -69,12 +69,6 @@ func (b *Buffer) Len() int {
return len(b.b) - b.off
}
// Reset resets the buffer to be empty, but it retains the underlying storage for use by future writes.
func (b *Buffer) Reset() {
b.b = b.b[:0]
b.off = 0
}
// ConsumeUint8 consumes a single byte from the Buffer.
// If Buffer does not have enough data, it will return ErrShortPacket.
func (b *Buffer) ConsumeUint8() (uint8, error) {

View File

@ -61,12 +61,6 @@ type RawPacket struct {
Data Buffer
}
// Reset clears the pointers and reference-semantic variables of RawPacket,
// making it suitable to be put into a sync.Pool.
func (p *RawPacket) Reset() {
p.Data.Reset()
}
// MarshalPacket returns p as a two-part binary encoding of p.
//
// The internal p.RequestID is overridden by the reqid argument.