MSP-8292 Up deps
This commit is contained in:
1 parent
3a66223a89
commit
5daaea50a1
186 files changed
+7092
-1579
No files matched your search
+25
-1
@@ -7,13 +7,37 @@ const maxUint64 = 1<<64 - 1
|
||||
|
||||
// About 2x faster then strconv.ParseInt because it only supports base 10, which is enough for JSON
|
||||
func parseInt(bytes []byte) (v int64, ok bool, overflow bool) {
|
||||
if len(bytes) == 0 {
|
||||
l := len(bytes)
|
||||
if l == 0 {
|
||||
return 0, false, false
|
||||
}
|
||||
|
||||
var neg bool = false
|
||||
i := 0
|
||||
if bytes[0] == '-' {
|
||||
neg = true
|
||||
i = 1
|
||||
}
|
||||
if i == l {
|
||||
return 0, false, false
|
||||
}
|
||||
|
||||
if l-i < 19 {
|
||||
for ; i < l; i++ {
|
||||
d := bytes[i] - '0'
|
||||
if d > 9 {
|
||||
return 0, false, false
|
||||
}
|
||||
v = 10*v + int64(d)
|
||||
}
|
||||
|
||||
if neg {
|
||||
return -v, true, false
|
||||
}
|
||||
return v, true, false
|
||||
}
|
||||
|
||||
if neg {
|
||||
bytes = bytes[1:]
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user