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-merkledag
Commits
b88c9c04
Commit
b88c9c04
authored
Feb 24, 2016
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes from review
License: MIT Signed-off-by:
Jeromy
<
jeromyj@gmail.com
>
parent
f8108394
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
merkledag.go
merkledag.go
+7
-8
No files found.
merkledag.go
View file @
b88c9c04
...
...
@@ -146,14 +146,13 @@ func FindLinks(links []key.Key, k key.Key, start int) []int {
}
func
(
ds
*
dagService
)
GetMany
(
ctx
context
.
Context
,
keys
[]
key
.
Key
)
(
<-
chan
*
Node
,
<-
chan
error
)
{
out
:=
make
(
chan
*
Node
)
out
:=
make
(
chan
*
Node
,
len
(
keys
)
)
errs
:=
make
(
chan
error
,
1
)
blocks
:=
ds
.
Blocks
.
GetBlocks
(
ctx
,
keys
)
var
count
int
go
func
()
{
defer
close
(
out
)
defer
close
(
errs
)
for
{
select
{
case
b
,
ok
:=
<-
blocks
:
...
...
@@ -168,13 +167,13 @@ func (ds *dagService) GetMany(ctx context.Context, keys []key.Key) (<-chan *Node
errs
<-
err
return
}
select
{
case
out
<-
nd
:
count
++
case
<-
ctx
.
Done
()
:
return
}
// buffered, no need to select
out
<-
nd
count
++
case
<-
ctx
.
Done
()
:
errs
<-
ctx
.
Err
()
return
}
}
...
...
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