Compare commits
No commits in common. "e0e5a72e90468f537a552f71404b025ebc1f8ef5" and "7d17744239abdbff2a8288b717f1a0ac933ad520" have entirely different histories.
e0e5a72e90
...
7d17744239
@ -73,16 +73,3 @@ func (rb *RingBuffer) GetLastPosition() int {
|
|||||||
return rb.tail
|
return rb.tail
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rb *RingBuffer) ContainsItem(item string) bool {
|
|
||||||
rb.mu.Lock()
|
|
||||||
defer rb.mu.Unlock()
|
|
||||||
|
|
||||||
for i := 0; i < rb.size; i++ {
|
|
||||||
index := (rb.head + i) % rb.size
|
|
||||||
if rb.buffer[index] == item {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user