From 0bee39642684e68bc18047f6e97a9a3c2c49fb78 Mon Sep 17 00:00:00 2001 From: Rueian Date: Sun, 4 Feb 2024 10:56:16 +0800 Subject: [PATCH] perf: remove unnecessary err check --- pipe.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pipe.go b/pipe.go index bf782d29..d35c37fc 100644 --- a/pipe.go +++ b/pipe.go @@ -995,10 +995,8 @@ func (p *pipe) syncDo(dl time.Time, dlOk bool, cmd Completed) (resp RedisResult) var msg RedisMessage err := writeCmd(p.w, cmd.Commands()) - if err == nil { - if err = p.w.Flush(); err == nil { - msg, err = syncRead(p.r) - } + if err = p.w.Flush(); err == nil { + msg, err = syncRead(p.r) } if err != nil { if errors.Is(err, os.ErrDeadlineExceeded) { @@ -1028,7 +1026,6 @@ func (p *pipe) syncDoMulti(dl time.Time, dlOk bool, resp []RedisResult, multi [] process: var err error var msg RedisMessage - for _, cmd := range multi { _ = writeCmd(p.w, cmd.Commands()) }