File tree Expand file tree Collapse file tree 5 files changed +13
-10
lines changed Expand file tree Collapse file tree 5 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,10 @@ func (e *Element[T]) GetExpiry() int64 {
6767 return e .value .GetExpiry ()
6868}
6969
70+ func (e * Element [T ]) Priority () uint64 {
71+ return e .value .Priority ()
72+ }
73+
7074func (l * List [T ]) First () * Element [T ] {
7175 if l .size == 0 {
7276 return nil
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ type Item interface {
3131 Priority () uint64
3232}
3333
34- type Mempool [T Item , E eheap .Item ] struct {
34+ type Mempool [T Item , E queue .Item ] struct {
3535 tracer trace.Tracer
3636
3737 mu sync.RWMutex
Original file line number Diff line number Diff line change 77 "github.com/ava-labs/hypersdk/internal/list"
88)
99
10- var _ Queue [list. Item , * list.Element [list. Item ]] = (* FIFOQueue [list. Item ])(nil )
10+ var _ Queue [Item , * list.Element [Item ]] = (* FIFOQueue [Item ])(nil )
1111
1212type FIFOQueue [T list.Item ] struct {
1313 * list.List [T ]
Original file line number Diff line number Diff line change 44package queue
55
66import (
7- "github.com/ava-labs/hypersdk/internal/list"
87 "github.com/ava-labs/hypersdk/internal/pheap"
98)
109
11- var _ Queue [list. Item , list. Item ] = (* PriorityQueue [list. Item ])(nil )
10+ var _ Queue [Item , Item ] = (* PriorityQueue [Item ])(nil )
1211
13- type PriorityQueue [T list. Item ] struct {
12+ type PriorityQueue [T Item ] struct {
1413 * pheap.PriorityHeap [T ]
1514}
1615
Original file line number Diff line number Diff line change @@ -13,11 +13,11 @@ type Item interface {
1313 Priority () uint64
1414}
1515
16- type Queue [T Item , Elem any ] interface {
16+ type Queue [T Item , E Item ] interface {
1717 Size () int
18- First () (Elem , bool )
18+ First () (E , bool )
1919 FirstValue () (T , bool )
20- Remove (Elem ) T
21- Push (T ) Elem
22- Restore (T ) Elem
20+ Remove (E ) T
21+ Push (T ) E
22+ Restore (T ) E
2323}
You can’t perform that action at this time.
0 commit comments