v0.0.524
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Failing after 1m22s

This commit is contained in:
Mike Schwörer 2024-10-05 01:41:10 +02:00
parent 335ef4d8e8
commit 69f0fedd66
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF
2 changed files with 8 additions and 2 deletions

View File

@ -61,6 +61,9 @@ func (rb *RingBuffer[T]) At(i int) T {
if i < 0 || i >= rb.size {
panic("Index out of bounds")
}
if rb.size < rb.capacity {
return rb.items[i]
}
return rb.items[(rb.head+i)%rb.capacity]
}
@ -68,6 +71,9 @@ func (rb *RingBuffer[T]) Get(i int) (T, bool) {
if i < 0 || i >= rb.size {
return *new(T), false
}
if rb.size < rb.capacity {
return rb.items[i], true
}
return rb.items[(rb.head+i)%rb.capacity], true
}

View File

@ -1,5 +1,5 @@
package goext
const GoextVersion = "0.0.523"
const GoextVersion = "0.0.524"
const GoextVersionTimestamp = "2024-10-05T01:28:46+0200"
const GoextVersionTimestamp = "2024-10-05T01:41:10+0200"