Skip to content

Commit

Permalink
imp
Browse files Browse the repository at this point in the history
  • Loading branch information
shamaton committed Mar 14, 2024
1 parent 4bda28d commit b73d904
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ext/decoder_stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ func (d *DecoderStreamCommon) ReadSizeN(r io.Reader, buf *common.Buffer, n int)
if len(buf.Data) <= n {
b = buf.Data[:n]
} else {
b = make([]byte, n)
buf.Data = append(buf.Data, make([]byte, n-len(buf.Data))...)
b = buf.Data
}
if _, err := r.Read(b); err != nil {
return emptyBytes, err
Expand Down
2 changes: 1 addition & 1 deletion internal/stream/decoding/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (d *decoder) readSizeN(n int) ([]byte, error) {
b = d.buf.Data[:n]
} else {
d.buf.Data = append(d.buf.Data, make([]byte, n-len(d.buf.Data))...)
b = make([]byte, n)
b = d.buf.Data
}
if _, err := d.r.Read(b); err != nil {
return emptyBytes, err
Expand Down

0 comments on commit b73d904

Please sign in to comment.