2
0
Fork 0
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:
Yi Duan 2021-09-06 16:58:03 +08:00 committed by GitHub
parent d2e150948a
commit 12e088f9e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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{}