Skip to content

Commit

Permalink
perf: remove unnecessary err check
Browse files Browse the repository at this point in the history
  • Loading branch information
rueian committed Feb 4, 2024
1 parent e0b7b93 commit 0bee396
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions pipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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())
}
Expand Down

0 comments on commit 0bee396

Please sign in to comment.