1
0
mirror of https://github.com/charlienet/go-mixed.git synced 2025-07-18 00:22:41 +08:00

优化range引用

This commit is contained in:
2022-07-04 12:01:44 +08:00
parent 44304f5b16
commit 886723997e
8 changed files with 143 additions and 12 deletions

View File

@ -16,7 +16,9 @@ func (r BytesResult) Hex() string {
func (r BytesResult) UppercaseHex() string {
dst := make([]byte, hex.EncodedLen(len(r)))
j := 0
for _, v := range r {
re := r[:]
for _, v := range re {
dst[j] = hextable[v>>4]
dst[j+1] = hextable[v&0x0f]
j += 2