Update Vendor
(*) github.com/Microsoft/hcsshim (*) golang.org/x/sys (*) github.com/x/cyrpto (*) github.com/sirupsen/logrus (*) github.com/Microsoft/go-winio (*) github.com/juju/errors (*) github.com/buger/jsonparser
This commit is contained in:
28
vendor/github.com/buger/jsonparser/bytes.go
generated
vendored
Normal file
28
vendor/github.com/buger/jsonparser/bytes.go
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
package jsonparser
|
||||
|
||||
// About 3x faster then strconv.ParseInt because does not check for range error and support only base 10, which is enough for JSON
|
||||
func parseInt(bytes []byte) (v int64, ok bool) {
|
||||
if len(bytes) == 0 {
|
||||
return 0, false
|
||||
}
|
||||
|
||||
var neg bool = false
|
||||
if bytes[0] == '-' {
|
||||
neg = true
|
||||
bytes = bytes[1:]
|
||||
}
|
||||
|
||||
for _, c := range bytes {
|
||||
if c >= '0' && c <= '9' {
|
||||
v = (10 * v) + int64(c-'0')
|
||||
} else {
|
||||
return 0, false
|
||||
}
|
||||
}
|
||||
|
||||
if neg {
|
||||
return -v, true
|
||||
} else {
|
||||
return v, true
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user