1
0
mirror of https://github.com/json-iterator/go.git synced 2025-06-12 22:47:42 +02:00

fix read int

This commit is contained in:
Tao Wen
2017-02-07 09:24:36 +08:00
parent 6880076b44
commit 2922666717
4 changed files with 26 additions and 2 deletions

View File

@ -1,6 +1,8 @@
package jsoniter
import "strconv"
import (
"strconv"
)
var intDigits []int8
@ -124,6 +126,7 @@ func (iter *Iterator) readUint32(c byte) (ret uint32) {
for i := iter.head; i < iter.tail; i++ {
ind = intDigits[iter.buf[i]]
if ind == invalidCharForNumber {
iter.head = i
return value
}
if value > uint32SafeToMultiply10 {
@ -181,6 +184,7 @@ func (iter *Iterator) readUint64(c byte) (ret uint64) {
for i := iter.head; i < iter.tail; i++ {
ind = intDigits[iter.buf[i]]
if ind == invalidCharForNumber {
iter.head = i
return value
}
if value > uint64SafeToMultiple10 {