forked from cerc-io/plugeth
all: use AbsTime.Add instead of conversion (#25417)
This commit is contained in:
@@ -87,13 +87,13 @@ func (q *LazyQueue) Refresh() {
|
||||
|
||||
// refresh re-evaluates items in the older queue and swaps the two queues
|
||||
func (q *LazyQueue) refresh(now mclock.AbsTime) {
|
||||
q.maxUntil = now + mclock.AbsTime(q.period)
|
||||
q.maxUntil = now.Add(q.period)
|
||||
for q.queue[0].Len() != 0 {
|
||||
q.Push(heap.Pop(q.queue[0]).(*item).value)
|
||||
}
|
||||
q.queue[0], q.queue[1] = q.queue[1], q.queue[0]
|
||||
q.indexOffset = 1 - q.indexOffset
|
||||
q.maxUntil += mclock.AbsTime(q.period)
|
||||
q.maxUntil = q.maxUntil.Add(q.period)
|
||||
}
|
||||
|
||||
// Push adds an item to the queue
|
||||
|
||||
Reference in New Issue
Block a user