aboutsummaryrefslogtreecommitdiff
path: root/bytesconv.go
diff options
context:
space:
mode:
authorGravatar ZYunH <zyunhjob@163.com> 2019-09-19 20:38:30 +0800
committerGravatar Kirill Danshin <kirill@danshin.pro> 2019-09-20 06:33:34 +0300
commit91138eed5fe48f98cd0a6594ea70f7d06e754cd9 (patch)
tree5a2fad06aa9a8f6b587241a6b86892297aa8ca33 /bytesconv.go
parentReplace hexCharUpeer with upperhex (#657) (diff)
downloadfasthttp-91138eed5fe48f98cd0a6594ea70f7d06e754cd9.tar.gz
fasthttp-91138eed5fe48f98cd0a6594ea70f7d06e754cd9.tar.bz2
fasthttp-91138eed5fe48f98cd0a6594ea70f7d06e754cd9.zip
Replace int2hexbyte with uppercase
Diffstat (limited to 'bytesconv.go')
-rw-r--r--bytesconv.go9
1 files changed, 1 insertions, 8 deletions
diff --git a/bytesconv.go b/bytesconv.go
index 5d87908..82b1640 100644
--- a/bytesconv.go
+++ b/bytesconv.go
@@ -296,7 +296,7 @@ func writeHexInt(w *bufio.Writer, n int) error {
buf := v.([]byte)
i := len(buf) - 1
for {
- buf[i] = int2hexbyte(n & 0xf)
+ buf[i] = upperhex[n&0xf]
n >>= 4
if n == 0 {
break
@@ -308,13 +308,6 @@ func writeHexInt(w *bufio.Writer, n int) error {
return err
}
-func int2hexbyte(n int) byte {
- if n < 10 {
- return '0' + byte(n)
- }
- return 'a' + byte(n) - 10
-}
-
var hex2intTable = func() []byte {
b := make([]byte, 256)
for i := 0; i < 256; i++ {