diff --git a/args.go b/args.go index f81ebd7..4ed61c4 100644 --- a/args.go +++ b/args.go @@ -391,8 +391,8 @@ func decodeArgAppend(dst, src []byte, decodePlus bool) []byte { if i+2 >= n { return append(dst, src[i:]...) } - x1 := unhex(src[i+1]) - x2 := unhex(src[i+2]) + x1 := hexbyte2int(src[i+1]) + x2 := hexbyte2int(src[i+2]) if x1 < 0 || x2 < 0 { dst = append(dst, c) } else { diff --git a/bytesconv.go b/bytesconv.go index df17b5c..e07fdcd 100644 --- a/bytesconv.go +++ b/bytesconv.go @@ -232,19 +232,6 @@ func unsafeBytesToStr(b []byte) string { return *(*string)(unsafe.Pointer(&b)) } -func unhex(c byte) int { - if c >= '0' && c <= '9' { - return int(c - '0') - } - if c >= 'a' && c <= 'f' { - return 10 + int(c-'a') - } - if c >= 'A' && c <= 'F' { - return 10 + int(c-'A') - } - return -1 -} - func appendQuotedArg(dst, v []byte) []byte { for _, c := range v { if c >= '0' && c <= '9' || c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c == '/' || c == '.' {