Skip to content

Commit

Permalink
Merge pull request ipfs/go-unixfs#93 from ipfs/schomatis/fix/dir/comp…
Browse files Browse the repository at this point in the history
…ute-size

fix(directory): initialize size when computing it

This commit was moved from ipfs/go-unixfs@06053e4
  • Loading branch information
aschmahmann authored May 21, 2021
2 parents aebf6e1 + f60162c commit d7b558d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions unixfs/io/directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ func NewDirectoryFromNode(dserv ipld.DAGService, node ipld.Node) (Directory, err
}

func (d *BasicDirectory) computeEstimatedSize() {
d.estimatedSize = 0
d.ForEachLink(nil, func(l *ipld.Link) error {
d.addToEstimatedSize(l.Name, l.Cid)
return nil
Expand Down

0 comments on commit d7b558d

Please sign in to comment.