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) {
return nil, fmt.Errorf("invalid link name '%s'", lnk.Name)
}
nd, err := lnk.GetNode(ctx, ds.dserv)
if err != nil {
return nil, err
}
var c child
if len(lnk.Name) == ds.maxpadlen {
nd, err := lnk.GetNode(ctx, ds.dserv)
if err != nil {
return nil, err
}
pbnd, ok := nd.(*dag.ProtoNode)
if !ok {
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