Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
qingyang-hu committed Dec 5, 2023
1 parent 37bb727 commit cf50fcb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bson/marshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ func Marshal(val interface{}) ([]byte, error) {
if err != nil {
return nil, err
}
enc := NewEncoder(vw)
enc := encPool.Get().(*Encoder)
defer encPool.Put(enc)
enc.Reset(vw)
enc.SetRegistry(DefaultRegistry)
err = enc.Encode(val)
if err != nil {
Expand Down

0 comments on commit cf50fcb

Please sign in to comment.