Skip to content

Commit

Permalink
opt: refine code
Browse files Browse the repository at this point in the history
  • Loading branch information
panjf2000 committed Dec 3, 2021
1 parent f1d1d77 commit 5d8fe64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/ringbuffer/ring_buffer_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (rb *RingBuffer) CopyFromSocket(fd int) (n int, err error) {
}
return
}
rb.Reset()
rb.r, rb.w = 0, 0
n, err = unix.Read(fd, rb.buf)
if n > 0 {
rb.w = (rb.w + n) % rb.size
Expand Down

0 comments on commit 5d8fe64

Please sign in to comment.