Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Commit

Permalink
ResolveToLastNode no longer fetches nodes it does not need
Browse files Browse the repository at this point in the history
  • Loading branch information
aschmahmann committed Aug 26, 2020
1 parent 1c1d3fc commit ac811c4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions resolver/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ func (r *Resolver) ResolveToLastNode(ctx context.Context, fpath path.Path) (cid.
return cid.Cid{}, nil, err
}

if len(rest) == 0 {
return lnk.Cid, nil, nil
}

next, err := lnk.GetNode(ctx, r.DAG)
if err != nil {
return cid.Cid{}, nil, err
Expand Down

0 comments on commit ac811c4

Please sign in to comment.