Selaa lähdekoodia

codec: set bytes flag to true for a bytesreader

That flag is used to ensure that zero-copy is honored when possible.
It seems to have been inadvertently removed during a refactor.

Fixes #193
Ugorji Nwoke 8 vuotta sitten
vanhempi
commit
756535a25c
1 muutettua tiedostoa jossa 1 lisäystä ja 0 poistoa
  1. 1 0
      codec/decode.go

+ 1 - 0
codec/decode.go

@@ -1338,6 +1338,7 @@ func (d *Decoder) Reset(r io.Reader) {
 
 func (d *Decoder) ResetBytes(in []byte) {
 	// d.s = d.sa[:0]
+	d.bytes = true
 	d.rb.reset(in)
 	d.r = &d.rb
 	d.resetCommon()