Skip to content

Commit afa66dc

Browse files
authored
fix grammar in alloc_string
1 parent b5b6aa3 commit afa66dc

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

decode.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff 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
//
6161
func (d *Decoder) AllocString() {
6262
d.sdata = string(d.data)

0 commit comments

Comments
 (0)