From b56dae8120d43b9acd3d3ed4d40100ffab7b972a Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Mon, 2 May 2022 14:05:18 +0100 Subject: [chore] Update all but bun libraries (#526) * update all but bun libraries Signed-off-by: kim * remove my personal build script changes Signed-off-by: kim --- vendor/github.com/tdewolff/parse/v2/strconv/int.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'vendor/github.com/tdewolff/parse/v2/strconv/int.go') diff --git a/vendor/github.com/tdewolff/parse/v2/strconv/int.go b/vendor/github.com/tdewolff/parse/v2/strconv/int.go index d8df0fd68..e3483bd3a 100644 --- a/vendor/github.com/tdewolff/parse/v2/strconv/int.go +++ b/vendor/github.com/tdewolff/parse/v2/strconv/int.go @@ -38,6 +38,26 @@ func ParseInt(b []byte) (int64, int) { return int64(n), i } +// ParseUint parses a byte-slice and returns the integer it represents. +// If an invalid character is encountered, it will stop there. +func ParseUint(b []byte) (uint64, int) { + i := 0 + n := uint64(0) + for i < len(b) { + c := b[i] + if n > math.MaxUint64/10 { + return 0, 0 + } else if c >= '0' && c <= '9' { + n *= 10 + n += uint64(c - '0') + } else { + break + } + i++ + } + return n, i +} + // LenInt returns the written length of an integer. func LenInt(i int64) int { if i < 0 { -- cgit v1.2.3