mirror of
https://github.com/ii64/sonic.git
synced 2026-06-21 00:46:43 +08:00
opt(ast): append string instead of []byte (#88)
Co-authored-by: duanyi.aster <duanyi.aster@bytedance.com> Co-authored-by: Oxygen <chenzhuoyu@users.noreply.github.com>
This commit is contained in:
parent
d2e150948a
commit
12e088f9e9
1 changed files with 6 additions and 12 deletions
|
|
@ -24,18 +24,12 @@ const (
|
||||||
_MaxBuffer = 4 * 1024 // 4KB buffer size
|
_MaxBuffer = 4 * 1024 // 4KB buffer size
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
const (
|
||||||
bytesNull = []byte("null")
|
bytesNull = "null"
|
||||||
bytesTrue = []byte("true")
|
bytesTrue = "true"
|
||||||
bytesFalse = []byte("false")
|
bytesFalse = "false"
|
||||||
bytesObject = []byte("{}")
|
bytesObject = "{}"
|
||||||
bytesArray = []byte("[]")
|
bytesArray = "[]"
|
||||||
|
|
||||||
lenNull = len("null")
|
|
||||||
lenTrue = len("true")
|
|
||||||
lenFalse = len("false")
|
|
||||||
lenObject = len("{}")
|
|
||||||
lenArray = len("[]")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var bytesPool = sync.Pool{}
|
var bytesPool = sync.Pool{}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue