Skip to content

Commit

Permalink
Merge branch 'valyala:master' into mem-usage
Browse files Browse the repository at this point in the history
  • Loading branch information
gaby committed Jul 31, 2024
2 parents 7cc15f9 + bb0c8dd commit b21cc71
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions bytesconv.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"io"
"math"
"net"
"strconv"
"sync"
"time"
)
Expand Down Expand Up @@ -127,21 +128,7 @@ func AppendUint(dst []byte, n int) []byte {
panic("BUG: int must be positive")
}

var b [20]byte
buf := b[:]
i := len(buf)
var q int
for n >= 10 {
i--
q = n / 10
buf[i] = '0' + byte(n-q*10)
n = q
}
i--
buf[i] = '0' + byte(n)

dst = append(dst, buf[i:]...)
return dst
return strconv.AppendUint(dst, uint64(n), 10)
}

// ParseUint parses uint from buf.
Expand Down

0 comments on commit b21cc71

Please sign in to comment.