1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-28 06:42:00 +03:00

Make cmd.String() faster

This commit is contained in:
Vladimir Mihailenco
2020-05-09 17:30:16 +03:00
parent 0557f66418
commit 3031343dae
2 changed files with 61 additions and 22 deletions

View File

@ -93,7 +93,8 @@ func (w *Writer) writeArg(v interface{}) error {
}
return w.int(0)
case time.Time:
return w.string(v.Format(time.RFC3339))
w.numBuf = v.AppendFormat(w.numBuf[:0], time.RFC3339Nano)
return w.bytes(w.numBuf)
case encoding.BinaryMarshaler:
b, err := v.MarshalBinary()
if err != nil {