mirror of
https://github.com/valyala/fasthttp.git
synced 2026-06-16 16:17:38 +03:00
Code cleanup: removed redundant unhex
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 == '.' {
|
||||
|
||||
Reference in New Issue
Block a user