mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-22 00:59:11 +01:00
small refactor
This commit is contained in:
@@ -26,10 +26,7 @@ func (e *Entries[T]) Add(now time.Time, info *T) {
|
||||
return
|
||||
}
|
||||
e.entries[e.index] = info
|
||||
e.index++
|
||||
if e.index >= maxEntries {
|
||||
e.index = 0
|
||||
}
|
||||
e.index = (e.index + 1) % maxEntries
|
||||
if e.count < maxEntries {
|
||||
e.count++
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user