We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ed6a27a commit bb0c8ddCopy full SHA for bb0c8dd
bytesconv.go
@@ -10,6 +10,7 @@ import (
10
"io"
11
"math"
12
"net"
13
+ "strconv"
14
"sync"
15
"time"
16
)
@@ -127,21 +128,7 @@ func AppendUint(dst []byte, n int) []byte {
127
128
panic("BUG: int must be positive")
129
}
130
- var b [20]byte
131
- buf := b[:]
132
- i := len(buf)
133
- var q int
134
- for n >= 10 {
135
- i--
136
- q = n / 10
137
- buf[i] = '0' + byte(n-q*10)
138
- n = q
139
- }
140
141
- buf[i] = '0' + byte(n)
142
-
143
- dst = append(dst, buf[i:]...)
144
- return dst
+ return strconv.AppendUint(dst, uint64(n), 10)
145
146
147
// ParseUint parses uint from buf.
0 commit comments