summaryrefslogtreecommitdiff
path: root/vendor/github.com/bytedance/sonic/internal/decoder/optdec/helper.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/bytedance/sonic/internal/decoder/optdec/helper.go')
-rw-r--r--vendor/github.com/bytedance/sonic/internal/decoder/optdec/helper.go17
1 files changed, 1 insertions, 16 deletions
diff --git a/vendor/github.com/bytedance/sonic/internal/decoder/optdec/helper.go b/vendor/github.com/bytedance/sonic/internal/decoder/optdec/helper.go
index 61faa6c80..0683f45ae 100644
--- a/vendor/github.com/bytedance/sonic/internal/decoder/optdec/helper.go
+++ b/vendor/github.com/bytedance/sonic/internal/decoder/optdec/helper.go
@@ -28,11 +28,6 @@ func SkipNumberFast(json string, start int) (int, bool) {
return pos, true
}
-
-func isSpace(c byte) bool {
- return c == ' ' || c == '\t' || c == '\n' || c == '\r'
-}
-
// pos is the start index of the raw
func ValidNumberFast(raw string) bool {
ret := utils.SkipNumber(raw, 0)
@@ -48,22 +43,12 @@ func ValidNumberFast(raw string) bool {
return true
}
-func SkipOneFast2(json string, pos *int) (int, error) {
- // find the number ending, we parsed in sonic-cpp, it always valid
- start := native.SkipOneFast(&json, pos)
- if start < 0 {
- return -1, error_syntax(*pos, json, types.ParsingError(-start).Error())
- }
- return start, nil
-}
-
func SkipOneFast(json string, pos int) (string, error) {
- // find the number ending, we parsed in sonic-cpp, it always valid
start := native.SkipOneFast(&json, &pos)
if start < 0 {
- // TODO: details error code
return "", error_syntax(pos, json, types.ParsingError(-start).Error())
}
+
return json[start:pos], nil
}