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

Commit ac811c4

Browse files
committed
ResolveToLastNode no longer fetches nodes it does not need
1 parent 1c1d3fc commit ac811c4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

resolver/resolver.go

Lines changed: 4 additions & 0 deletions
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)