Skip to content

Commit

Permalink
eheap passes
Browse files Browse the repository at this point in the history
  • Loading branch information
wlawt committed Apr 25, 2024
1 parent 396ad07 commit a9c2e94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions eheap/eheap.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type Item interface {
// instead of grouping by expiry to support this feature, which makes it
// less efficient).
type ExpiryHeap[T Item] struct {
minHeap *heap.Heap[T, int64]
minHeap *heap.Heap[ids.ID, T, int64]
}

// New returns an instance of ExpiryHeap with minHeap and maxHeap
Expand All @@ -37,7 +37,7 @@ func New[T Item](items int) *ExpiryHeap[T] {
func (eh *ExpiryHeap[T]) Add(item T) {
itemID := item.ID()
poolLen := eh.minHeap.Len()
eh.minHeap.Push(&heap.Entry[T, int64]{
eh.minHeap.Push(&heap.Entry[ids.ID, T, int64]{
ID: itemID,
Val: item.Expiry(),
Item: item,
Expand Down

0 comments on commit a9c2e94

Please sign in to comment.