mirror of https://github.com/goccy/go-json.git
Add optimized StructEnd operation to vm
This commit is contained in:
parent
1f5e0cb5fd
commit
17f7434e93
11
encode.go
11
encode.go
|
@ -312,6 +312,17 @@ func encodeIndentComma(b []byte) []byte {
|
|||
return append(b, ',', '\n')
|
||||
}
|
||||
|
||||
func appendStructEnd(b []byte) []byte {
|
||||
return append(b, '}', ',')
|
||||
}
|
||||
|
||||
func (e *Encoder) appendStructEndIndent(b []byte, indent int) []byte {
|
||||
b = append(b, '\n')
|
||||
b = append(b, e.prefix...)
|
||||
b = append(b, bytes.Repeat(e.indentStr, indent)...)
|
||||
return append(b, '}', ',', '\n')
|
||||
}
|
||||
|
||||
func encodeByteSlice(b []byte, src []byte) []byte {
|
||||
encodedLen := base64.StdEncoding.EncodedLen(len(src))
|
||||
b = append(b, '"')
|
||||
|
|
2210
encode_vm.go
2210
encode_vm.go
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue