2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-30 00:33:57 +00:00

checker: Reduce cost of debug log

Avoid duplicate allocation of the Subtree list.
This commit is contained in:
Michael Eischer 2019-07-06 18:12:48 +02:00
parent 70f4c014ef
commit c66a0e408c

View File

@ -535,8 +535,9 @@ func filterTrees(ctx context.Context, backlog restic.IDs, loaderChan chan<- rest
debug.Log("received job with nil tree pointer: %v (ID %v)", j.error, j.ID) debug.Log("received job with nil tree pointer: %v (ID %v)", j.error, j.ID)
err = errors.New("tree is nil and error is nil") err = errors.New("tree is nil and error is nil")
} else { } else {
debug.Log("subtrees for tree %v: %v", j.ID, j.Tree.Subtrees()) subtrees := j.Tree.Subtrees()
for _, id := range j.Tree.Subtrees() { debug.Log("subtrees for tree %v: %v", j.ID, subtrees)
for _, id := range subtrees {
if id.IsNull() { if id.IsNull() {
// We do not need to raise this error here, it is // We do not need to raise this error here, it is
// checked when the tree is checked. Just make sure // checked when the tree is checked. Just make sure