diff options
author | ZYunH <zyunhjob@163.com> | 2019-09-19 20:38:30 +0800 |
---|---|---|
committer | Kirill Danshin <kirill@danshin.pro> | 2019-09-20 06:33:34 +0300 |
commit | 91138eed5fe48f98cd0a6594ea70f7d06e754cd9 (patch) | |
tree | 5a2fad06aa9a8f6b587241a6b86892297aa8ca33 /bytesconv.go | |
parent | Replace hexCharUpeer with upperhex (#657) (diff) | |
download | fasthttp-91138eed5fe48f98cd0a6594ea70f7d06e754cd9.tar.gz fasthttp-91138eed5fe48f98cd0a6594ea70f7d06e754cd9.tar.bz2 fasthttp-91138eed5fe48f98cd0a6594ea70f7d06e754cd9.zip |
Replace int2hexbyte with uppercase
Diffstat (limited to 'bytesconv.go')
-rw-r--r-- | bytesconv.go | 9 |
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++ { |