File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,10 +22,10 @@ func NewDecoder(data []byte) *Decoder {
2222 }
2323}
2424
25- // AllocString pre-allocate a string version of the data before starting
26- // decoding .
27- // It is used to make the decode operation more fast (see below) by doing one
28- // allocation operation for string conversion(from bytes), and then use
25+ // AllocString pre-allocates a string version of the data before starting
26+ // to decode the data .
27+ // It is used to make the decode operation faster (see below) by doing one
28+ // allocation operation for string conversion(from bytes), and then uses
2929// "slicing" to create non-escaped strings in the "Decoder.string" method.
3030// However, string is a read-only slice, and since the slice references the
3131// original array, as long as the slice is kept around, the garbage collector
@@ -56,7 +56,7 @@ func NewDecoder(data []byte) *Decoder {
5656// delete(ev, "baz") // or ev["baz"] = "qux"
5757//
5858// // inpect memory stats again; MemStats.Alloc ~= 1M
59- // // it means that the chunk that sat in the "baz" value is not freed
59+ // // it means that the chunk that was located in the "baz" value is not freed
6060//
6161func (d * Decoder ) AllocString () {
6262 d .sdata = string (d .data )
You can’t perform that action at this time.
0 commit comments