From caecc84defc7061fbdb367930a31f99fe8b2e349 Mon Sep 17 00:00:00 2001 From: Cassondra Foesch Date: Mon, 22 Mar 2021 12:22:56 +0000 Subject: [PATCH] encoding: it is no longer intended that Buffer/RawPacket would be pooled, the byte slices should be --- encoding/ssh/filexfer/buffer.go | 6 ------ encoding/ssh/filexfer/packets.go | 6 ------ 2 files changed, 12 deletions(-) diff --git a/encoding/ssh/filexfer/buffer.go b/encoding/ssh/filexfer/buffer.go index 22b5d93..5eafc57 100644 --- a/encoding/ssh/filexfer/buffer.go +++ b/encoding/ssh/filexfer/buffer.go @@ -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) { diff --git a/encoding/ssh/filexfer/packets.go b/encoding/ssh/filexfer/packets.go index bf5a661..78823e7 100644 --- a/encoding/ssh/filexfer/packets.go +++ b/encoding/ssh/filexfer/packets.go @@ -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.