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
032dcd44
Commit
032dcd44
authored
Dec 25, 2018
by
Bamvor Zhang
Committed by
Lucas Molas
Jan 16, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dag: remove trickleDepthInfo
License: MIT Signed-off-by:
Bamvor Zhang
<
jian.zhang@ipfsbit.com
>
parent
c2ac0aa2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
11 deletions
+3
-11
importer/trickle/trickledag.go
importer/trickle/trickledag.go
+3
-11
No files found.
importer/trickle/trickledag.go
View file @
032dcd44
...
...
@@ -102,7 +102,7 @@ func Append(ctx context.Context, basen ipld.Node, db *h.DagBuilderHelper) (out i
}
// Get depth of this 'tree'
n
,
layerProgress
:=
trickleDepthInfo
FSNode
(
fsn
,
db
.
Maxlinks
())
n
,
layerProgress
:=
trickleDepthInfo
(
fsn
,
db
.
Maxlinks
())
if
n
==
0
{
// If direct blocks not filled...
if
err
:=
db
.
FillFSNodeLayer
(
fsn
);
err
!=
nil
{
...
...
@@ -201,7 +201,7 @@ func appendRec(ctx context.Context, fsn *h.FSNodeOverDag, db *h.DagBuilderHelper
}
// Get depth of this 'tree'
n
,
layerProgress
:=
trickleDepthInfo
FSNode
(
fsn
,
db
.
Maxlinks
())
n
,
layerProgress
:=
trickleDepthInfo
(
fsn
,
db
.
Maxlinks
())
if
n
==
0
{
// If direct blocks not filled...
if
err
:=
db
.
FillFSNodeLayer
(
fsn
);
err
!=
nil
{
...
...
@@ -241,16 +241,8 @@ func appendRec(ctx context.Context, fsn *h.FSNodeOverDag, db *h.DagBuilderHelper
return
fsn
,
fsn
.
FileSize
(),
nil
}
func
trickleDepthInfo
(
node
*
h
.
UnixfsNode
,
maxlinks
int
)
(
int
,
int
)
{
n
:=
node
.
NumChildren
()
if
n
<
maxlinks
{
return
0
,
0
}
return
((
n
-
maxlinks
)
/
layerRepeat
)
+
1
,
(
n
-
maxlinks
)
%
layerRepeat
}
func
trickleDepthInfo
FSNode
(
node
*
h
.
FSNodeOverDag
,
maxlinks
int
)
(
int
,
int
)
{
func
trickleDepthInfo
(
node
*
h
.
FSNodeOverDag
,
maxlinks
int
)
(
int
,
int
)
{
n
:=
node
.
NumChildren
()
if
n
<
maxlinks
{
return
0
,
0
...
...
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