Skip to content

Commit

Permalink
add NewNode() for Priority Queue
Browse files Browse the repository at this point in the history
  • Loading branch information
networkchain committed Oct 29, 2017
1 parent c823182 commit 10dc113
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,19 @@ func (m *Makross) NewPriorityQueue() *prior.PriorityQueue {
return prior.NewPriorityQueue()
}

func (m *Makross) NewNode(key interface{}, v interface{}, priority int) *prior.Node {
return prior.NewNode(key, v, priority)
}

// NewPriorityQueue New PriorityQueue
func (c *Context) NewPriorityQueue() *prior.PriorityQueue {
return c.makross.NewPriorityQueue()
}

func (c *Context) NewNode(key interface{}, v interface{}, priority int) *prior.Node {
return prior.NewNode(key, v, priority)
}

// SetPriorityQueueWith c.makross.QueuesMap[key] = c.NewPriorityQueue()
func (m *Makross) SetPriorityQueueWith(key interface{}) *sync.Map {
if m.QueuesMap == nil {
Expand Down

0 comments on commit 10dc113

Please sign in to comment.