Skip to content

Commit

Permalink
Replace int2hexbyte with uppercase
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyunhao116 authored and kirillDanshin committed Sep 20, 2019
1 parent 9bc19f8 commit 91138ee
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions bytesconv.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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++ {
Expand Down

0 comments on commit 91138ee

Please sign in to comment.