Skip to content

Commit 946a4b9

Browse files
committed
fixed ResetBuffer of Encoder and Decoder
1 parent abce6f6 commit 946a4b9

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

io/decoder.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
| |
77
| io/decoder.go |
88
| |
9-
| LastModified: Mar 18, 2022 |
9+
| LastModified: Dec 13, 2023 |
1010
| Author: Ma Bingyao <[email protected]> |
1111
| |
1212
\*________________________________________________________*/
@@ -341,6 +341,10 @@ func (dec *Decoder) ResetBuffer() *Decoder {
341341
}
342342
dec.head = 0
343343
dec.tail = 0
344+
dec.Error = nil
345+
dec.MapType = MapTypeIIMap
346+
dec.RealType = RealTypeFloat64
347+
dec.LongType = LongTypeInt
344348
return dec
345349
}
346350

io/encoder.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
| |
77
| io/encoder.go |
88
| |
9-
| LastModified: Feb 27, 2022 |
9+
| LastModified: Dec 13, 2023 |
1010
| Author: Ma Bingyao <[email protected]> |
1111
| |
1212
\*________________________________________________________*/
@@ -313,6 +313,7 @@ func (enc *Encoder) Reset() *Encoder {
313313
// ResetBuffer of the Encoder.
314314
func (enc *Encoder) ResetBuffer() *Encoder {
315315
enc.buf = enc.buf[:0]
316+
enc.Error = nil
316317
return enc
317318
}
318319

0 commit comments

Comments
 (0)