mirror of https://github.com/goccy/go-json.git
Fix calculating of buffer length at reset
This commit is contained in:
parent
d4a64f8cde
commit
3b4e3255e3
|
@ -61,8 +61,8 @@ func (s *stream) statForRetry() ([]byte, int64, unsafe.Pointer) {
|
||||||
func (s *stream) reset() {
|
func (s *stream) reset() {
|
||||||
s.offset += s.cursor
|
s.offset += s.cursor
|
||||||
s.buf = s.buf[s.cursor:]
|
s.buf = s.buf[s.cursor:]
|
||||||
|
s.length -= s.cursor
|
||||||
s.cursor = 0
|
s.cursor = 0
|
||||||
s.length = int64(len(s.buf))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *stream) readBuf() []byte {
|
func (s *stream) readBuf() []byte {
|
||||||
|
|
Loading…
Reference in New Issue