Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-bitswap
Commits
fc6936d8
Commit
fc6936d8
authored
Dec 16, 2014
by
Brian Tiger Chow
Committed by
Juan Batiz-Benet
Dec 17, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mv comment
License: MIT Signed-off-by:
Brian Tiger Chow
<
brian@perfmode.com
>
parent
fa38bee3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
strategy/taskqueue.go
strategy/taskqueue.go
+1
-1
No files found.
strategy/taskqueue.go
View file @
fc6936d8
...
@@ -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,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment