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-unixfs
Commits
3cc73ee4
Commit
3cc73ee4
authored
Oct 16, 2018
by
Overbool
Committed by
Lucas Molas
Oct 16, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(hamt): add error in makeShardValue
parent
9e75a2ec
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
hamt/hamt.go
hamt/hamt.go
+16
-6
No files found.
hamt/hamt.go
View file @
3cc73ee4
...
...
@@ -190,14 +190,17 @@ func (ds *Shard) Node() (ipld.Node, error) {
return
out
,
nil
}
func
(
ds
*
Shard
)
makeShardValue
(
lnk
*
ipld
.
Link
)
*
Shard
{
func
(
ds
*
Shard
)
makeShardValue
(
lnk
*
ipld
.
Link
)
(
*
Shard
,
error
)
{
lnk2
:=
*
lnk
s
,
_
:=
makeShard
(
ds
.
dserv
,
ds
.
tableSize
)
s
,
err
:=
makeShard
(
ds
.
dserv
,
ds
.
tableSize
)
if
err
!=
nil
{
return
nil
,
err
}
s
.
key
=
lnk
.
Name
[
ds
.
maxpadlen
:
]
s
.
val
=
&
lnk2
return
s
return
s
,
nil
}
func
hash
(
val
[]
byte
)
[]
byte
{
...
...
@@ -305,7 +308,11 @@ func (ds *Shard) loadChild(ctx context.Context, i int) (*Shard, error) {
c
=
cds
}
else
{
c
=
ds
.
makeShardValue
(
lnk
)
s
,
err
:=
ds
.
makeShardValue
(
lnk
)
if
err
!=
nil
{
return
nil
,
err
}
c
=
s
}
ds
.
children
[
i
]
=
c
...
...
@@ -447,8 +454,11 @@ func makeAsyncTrieGetLinks(dagService ipld.DAGService, onShardValue func(shard *
if
lnkLinkType
==
shardLink
{
childShards
=
append
(
childShards
,
lnk
)
}
else
{
sv
:=
directoryShard
.
makeShardValue
(
lnk
)
err
:=
onShardValue
(
sv
)
sv
,
err
:=
directoryShard
.
makeShardValue
(
lnk
)
if
err
!=
nil
{
return
nil
,
err
}
err
=
onShardValue
(
sv
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
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