forked from TrueCloudLab/frostfs-node
[#1642] tree: Refactor getSortedSubTree
* Reuse `item` as result for `forest.TreeSortedByFilename` invocation. Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
parent
39f549a7ab
commit
a7ac30da9c
1 changed files with 3 additions and 4 deletions
|
@ -463,14 +463,13 @@ func getSortedSubTree(ctx context.Context, srv TreeService_GetSubTreeServer, cid
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
nodes, last, err := forest.TreeSortedByFilename(ctx, cid, b.GetTreeId(), item.parent, item.last, batchSize)
|
var err error
|
||||||
|
item.values, item.last, err = forest.TreeSortedByFilename(ctx, cid, b.GetTreeId(), item.parent, item.last, batchSize)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
item.values = nodes
|
|
||||||
item.last = last
|
|
||||||
|
|
||||||
if len(nodes) == 0 {
|
if len(item.values) == 0 {
|
||||||
stack = stack[:len(stack)-1]
|
stack = stack[:len(stack)-1]
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue