From 3b4e3255e38fcd3fe7166a73cae318641a2a5373 Mon Sep 17 00:00:00 2001 From: Masaaki Goshima Date: Thu, 6 May 2021 02:46:01 +0900 Subject: [PATCH] Fix calculating of buffer length at reset --- decode_stream.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/decode_stream.go b/decode_stream.go index 7ae52af..0d3e263 100644 --- a/decode_stream.go +++ b/decode_stream.go @@ -61,8 +61,8 @@ func (s *stream) statForRetry() ([]byte, int64, unsafe.Pointer) { func (s *stream) reset() { s.offset += s.cursor s.buf = s.buf[s.cursor:] + s.length -= s.cursor s.cursor = 0 - s.length = int64(len(s.buf)) } func (s *stream) readBuf() []byte {