Skip to content

Commit

Permalink
gzip: Copy bufio.Reader on Reset (#860)
Browse files Browse the repository at this point in the history
The code already checks to see if the buffer can be reused, but since
it's not copied in the overwrite, a new buffer is allocated each time.
  • Loading branch information
thatguystone committed Sep 18, 2023
1 parent 0e8837c commit fd16146
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions gzip/gunzip.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ func (z *Reader) Reset(r io.Reader) error {
*z = Reader{
decompressor: z.decompressor,
multistream: true,
br: z.br,
}
if rr, ok := r.(flate.Reader); ok {
z.r = rr
Expand Down

0 comments on commit fd16146

Please sign in to comment.