Skip to content

Commit

Permalink
reset should set vr to zero
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfuze committed Nov 2, 2021
1 parent 547e693 commit 2c3b489
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ring_buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func NewWithData(data []byte) *RingBuffer {
func (r *RingBuffer) WithData(data []byte) {
r.r = 0
r.w = 0
r.vr = 0
r.isEmpty = false
r.size = len(data)
r.buf = data
Expand Down Expand Up @@ -396,6 +397,7 @@ func (r *RingBuffer) IsEmpty() bool {

func (r *RingBuffer) Reset() {
r.r = 0
r.vr = 0
r.w = 0
r.isEmpty = true
}
Expand Down

0 comments on commit 2c3b489

Please sign in to comment.