mirror of
https://github.com/yusing/godoxy.git
synced 2025-06-09 04:52:35 +02:00
small refactor
This commit is contained in:
parent
10d23828a7
commit
41d37579dc
1 changed files with 1 additions and 4 deletions
|
@ -26,10 +26,7 @@ func (e *Entries[T]) Add(now time.Time, info *T) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
e.entries[e.index] = info
|
e.entries[e.index] = info
|
||||||
e.index++
|
e.index = (e.index + 1) % maxEntries
|
||||||
if e.index >= maxEntries {
|
|
||||||
e.index = 0
|
|
||||||
}
|
|
||||||
if e.count < maxEntries {
|
if e.count < maxEntries {
|
||||||
e.count++
|
e.count++
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue