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

Commit 9ba33de

Browse files
aschmahmannrvagg
authored andcommittedDec 3, 2020
ResolveToLastNode no longer fetches nodes it does not need
1 parent 95ea577 commit 9ba33de

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎resolver/resolver.go

+4
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ func (r *Resolver) ResolveToLastNode(ctx context.Context, fpath path.Path) (cid.
8989
return cid.Cid{}, nil, err
9090
}
9191

92+
if len(rest) == 0 {
93+
return lnk.Cid, nil, nil
94+
}
95+
9296
next, err := lnk.GetNode(ctx, r.DAG)
9397
if err != nil {
9498
return cid.Cid{}, nil, err

0 commit comments

Comments
 (0)
This repository has been archived.