forked from mirror/brotli
Simplify control flow in Reader.Reset.
This commit is contained in:
parent
87d8f4575c
commit
47c0dbab12
|
@ -33,10 +33,9 @@ func NewReader(src io.Reader) *Reader {
|
||||||
func (r *Reader) Reset(src io.Reader) error {
|
func (r *Reader) Reset(src io.Reader) error {
|
||||||
decoderStateInit(r)
|
decoderStateInit(r)
|
||||||
r.src = src
|
r.src = src
|
||||||
if r.buf != nil {
|
if r.buf == nil {
|
||||||
return nil
|
|
||||||
}
|
|
||||||
r.buf = make([]byte, readBufSize)
|
r.buf = make([]byte, readBufSize)
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue