提交 39d71931 作者: Brian Tiger Chow 提交者: Juan Batiz-Benet

mv comment

License: MIT
Signed-off-by: 's avatarBrian Tiger Chow <brian@perfmode.com>
上级 7fdbae13
...@@ -10,6 +10,7 @@ import ( ...@@ -10,6 +10,7 @@ import (
// to help decide how to sort tasks (on add) and how to select // to help decide how to sort tasks (on add) and how to select
// tasks (on getnext). For now, we are assuming a dumb/nice strategy. // tasks (on getnext). For now, we are assuming a dumb/nice strategy.
type taskQueue struct { type taskQueue struct {
// TODO: make this into a priority queue
tasks []*task tasks []*task
taskmap map[string]*task taskmap map[string]*task
} }
...@@ -27,7 +28,6 @@ type task struct { ...@@ -27,7 +28,6 @@ type task struct {
} }
// Push currently adds a new task to the end of the list // Push currently adds a new task to the end of the list
// TODO: make this into a priority queue
func (tl *taskQueue) Push(block u.Key, priority int, to peer.Peer) { func (tl *taskQueue) Push(block u.Key, priority int, to peer.Peer) {
if task, ok := tl.taskmap[taskKey(to, block)]; ok { if task, ok := tl.taskmap[taskKey(to, block)]; ok {
// TODO: when priority queue is implemented, // TODO: when priority queue is implemented,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论