Skip to content

Commit

Permalink
zstd: fix: check r.err != nil but return a nil value error err (#…
Browse files Browse the repository at this point in the history
…1028)

* fix: check `r.err != nil` but return a nil value error `err`

Signed-off-by: alingse <alingse@foxmail.com>

* fix: check `r.err != nil` but return a nil value error `err`

Signed-off-by: alingse <alingse@foxmail.com>

---------

Signed-off-by: alingse <alingse@foxmail.com>
  • Loading branch information
alingse authored Dec 16, 2024
1 parent 4d8527a commit bbaf27d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions zstd/snappy.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func (r *SnappyConverter) Convert(in io.Reader, w io.Writer) (int64, error) {

n, r.err = w.Write(r.block.output)
if r.err != nil {
return written, err
return written, r.err
}
written += int64(n)
continue
Expand Down Expand Up @@ -239,7 +239,7 @@ func (r *SnappyConverter) Convert(in io.Reader, w io.Writer) (int64, error) {
}
n, r.err = w.Write(r.block.output)
if r.err != nil {
return written, err
return written, r.err
}
written += int64(n)
continue
Expand Down

0 comments on commit bbaf27d

Please sign in to comment.