Skip to content

Commit

Permalink
Merge pull request #107 from francoispqt/feature/improved-stream
Browse files Browse the repository at this point in the history
Improve streaming
  • Loading branch information
francoispqt authored Mar 29, 2019
2 parents 6901b37 + e5b786c commit e46791d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,9 @@ func (dec *Decoder) read() bool {
// if we reach the end, double the buffer to ensure there's always more space
if len(dec.data) == dec.length {
nLen := dec.length * 2
if nLen == 0 {
nLen = 512
}
Buf := make([]byte, nLen, nLen)
copy(Buf, dec.data)
dec.data = Buf
Expand Down

0 comments on commit e46791d

Please sign in to comment.