You've already forked json-iterator
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:
@ -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 {
|
||||
|
Reference in New Issue
Block a user