Commit e06436d0 authored by Steven Allen's avatar Steven Allen

don't resolve children unnecessarily when listing a sharded directory

We only need to get the child if it's a shard.

License: MIT
Signed-off-by: default avatarSteven Allen <steven@stebalien.com>
parent 3cc4658a
...@@ -289,13 +289,13 @@ func (ds *Shard) loadChild(ctx context.Context, i int) (child, error) { ...@@ -289,13 +289,13 @@ func (ds *Shard) loadChild(ctx context.Context, i int) (child, error) {
return nil, fmt.Errorf("invalid link name '%s'", lnk.Name) return nil, fmt.Errorf("invalid link name '%s'", lnk.Name)
} }
var c child
if len(lnk.Name) == ds.maxpadlen {
nd, err := lnk.GetNode(ctx, ds.dserv) nd, err := lnk.GetNode(ctx, ds.dserv)
if err != nil { if err != nil {
return nil, err return nil, err
} }
var c child
if len(lnk.Name) == ds.maxpadlen {
pbnd, ok := nd.(*dag.ProtoNode) pbnd, ok := nd.(*dag.ProtoNode)
if !ok { if !ok {
return nil, dag.ErrNotProtobuf return nil, dag.ErrNotProtobuf
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment