mirror of
https://github.com/redis/go-redis.git
synced 2025-07-29 17:41:15 +03:00
Reuse buffer for constructing request.
This commit is contained in:
@ -21,8 +21,7 @@ var (
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
func PackReq(args []string) []byte {
|
||||
buf := make([]byte, 0, 1024)
|
||||
func AppendReq(buf []byte, args []string) []byte {
|
||||
buf = append(buf, '*')
|
||||
buf = strconv.AppendUint(buf, uint64(len(args)), 10)
|
||||
buf = append(buf, '\r', '\n')
|
||||
|
Reference in New Issue
Block a user