1
0
mirror of https://github.com/redis/go-redis.git synced 2025-04-17 20:17:02 +03:00

Use unsafe StringToBytes to speedup StringCmd.Bytes

This commit is contained in:
Vladimir Mihailenco 2019-07-27 16:40:31 +03:00
parent ec312e4dd5
commit f76700581d

View File

@ -9,6 +9,7 @@ import (
"github.com/go-redis/redis/internal"
"github.com/go-redis/redis/internal/proto"
"github.com/go-redis/redis/internal/util"
)
type Cmder interface {
@ -617,7 +618,7 @@ func (cmd *StringCmd) Result() (string, error) {
}
func (cmd *StringCmd) Bytes() ([]byte, error) {
return []byte(cmd.val), cmd.err
return util.StringToBytes(cmd.val), cmd.err
}
func (cmd *StringCmd) Int() (int, error) {