Skip to content

Commit

Permalink
Merge pull request #8 from sunfuze/fix-reset
Browse files Browse the repository at this point in the history
reset should set vr to zero
  • Loading branch information
Allenxuxu authored Nov 2, 2021
2 parents 547e693 + 2c3b489 commit 7371440
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 7371440

Please sign in to comment.