restore: optimize memory usage

This commit is contained in:
Michael Eischer 2024-06-29 17:24:47 +02:00
parent 1369658a32
commit a9a60f77ce

View file

@ -120,7 +120,9 @@ func (res *Restorer) traverseTree(ctx context.Context, target, location string,
return hasRestored, res.Error(location, err)
}
for _, node := range tree.Nodes {
for i, node := range tree.Nodes {
// allow GC of tree node
tree.Nodes[i] = nil
// ensure that the node name does not contain anything that refers to a
// top-level directory.