Skip to content

Commit

Permalink
fixed ResetBuffer of Encoder and Decoder
Browse files Browse the repository at this point in the history
  • Loading branch information
andot committed Sep 13, 2023
1 parent abce6f6 commit 946a4b9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion io/decoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
| |
| io/decoder.go |
| |
| LastModified: Mar 18, 2022 |
| LastModified: Dec 13, 2023 |
| Author: Ma Bingyao <andot@hprose.com> |
| |
\*________________________________________________________*/
Expand Down Expand Up @@ -341,6 +341,10 @@ func (dec *Decoder) ResetBuffer() *Decoder {
}
dec.head = 0
dec.tail = 0
dec.Error = nil
dec.MapType = MapTypeIIMap
dec.RealType = RealTypeFloat64
dec.LongType = LongTypeInt
return dec
}

Expand Down
3 changes: 2 additions & 1 deletion io/encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
| |
| io/encoder.go |
| |
| LastModified: Feb 27, 2022 |
| LastModified: Dec 13, 2023 |
| Author: Ma Bingyao <andot@hprose.com> |
| |
\*________________________________________________________*/
Expand Down Expand Up @@ -313,6 +313,7 @@ func (enc *Encoder) Reset() *Encoder {
// ResetBuffer of the Encoder.
func (enc *Encoder) ResetBuffer() *Encoder {
enc.buf = enc.buf[:0]
enc.Error = nil
return enc
}

Expand Down

0 comments on commit 946a4b9

Please sign in to comment.