Compare commits
No commits in common. "main" and "v1.0.1" have entirely different histories.
@ -77,10 +77,6 @@ func (rb *RingBuffer) ContainsItem(item string) bool {
|
|||||||
rb.mu.Lock()
|
rb.mu.Lock()
|
||||||
defer rb.mu.Unlock()
|
defer rb.mu.Unlock()
|
||||||
|
|
||||||
if rb.head == -1 {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
for i := 0; i < rb.size; i++ {
|
for i := 0; i < rb.size; i++ {
|
||||||
index := (rb.head + i) % rb.size
|
index := (rb.head + i) % rb.size
|
||||||
if rb.buffer[index] == item {
|
if rb.buffer[index] == item {
|
||||||
@ -90,4 +86,3 @@ func (rb *RingBuffer) ContainsItem(item string) bool {
|
|||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user