diff options
Diffstat (limited to 'vendor/github.com/bytedance/sonic/internal/encoder/alg/spec.go')
| -rw-r--r-- | vendor/github.com/bytedance/sonic/internal/encoder/alg/spec.go | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/vendor/github.com/bytedance/sonic/internal/encoder/alg/spec.go b/vendor/github.com/bytedance/sonic/internal/encoder/alg/spec.go index 6f76ac739..ecdbfb7bd 100644 --- a/vendor/github.com/bytedance/sonic/internal/encoder/alg/spec.go +++ b/vendor/github.com/bytedance/sonic/internal/encoder/alg/spec.go @@ -21,6 +21,7 @@ package alg import ( "runtime" + "strconv" "unsafe" "github.com/bytedance/sonic/internal/native" @@ -177,22 +178,9 @@ func F32toa(buf []byte, v float32) ([]byte) { } func I64toa(buf []byte, v int64) ([]byte) { - buf = rt.GuardSlice2(buf, 32) - ret := native.I64toa((*byte)(rt.IndexByte(buf, len(buf))), v) - if ret > 0 { - return buf[:len(buf)+ret] - } else { - return buf - } + return strconv.AppendInt(buf, v, 10) } func U64toa(buf []byte, v uint64) ([]byte) { - buf = rt.GuardSlice2(buf, 32) - ret := native.U64toa((*byte)(rt.IndexByte(buf, len(buf))), v) - if ret > 0 { - return buf[:len(buf)+ret] - } else { - return buf - } + return strconv.AppendUint(buf, v, 10) } - |
