archiver: Clarify names

This commit is contained in:
Alexander Neumann 2018-05-12 21:59:58 +02:00
parent 21c83b1725
commit 256104111d
1 changed files with 10 additions and 10 deletions

View File

@ -263,8 +263,8 @@ type FutureNode struct {
isFile bool isFile bool
file FutureFile file FutureFile
isDir bool isTree bool
dir FutureTree tree FutureTree
} }
func (fn *FutureNode) wait(ctx context.Context) { func (fn *FutureNode) wait(ctx context.Context) {
@ -280,15 +280,15 @@ func (fn *FutureNode) wait(ctx context.Context) {
fn.file = FutureFile{} fn.file = FutureFile{}
fn.isFile = false fn.isFile = false
case fn.isDir: case fn.isTree:
// wait for and collect the data for the dir // wait for and collect the data for the dir
fn.dir.Wait(ctx) fn.tree.Wait(ctx)
fn.node = fn.dir.Node() fn.node = fn.tree.Node()
fn.stats = fn.dir.Stats() fn.stats = fn.tree.Stats()
// ensure the other stuff can be garbage-collected // ensure the other stuff can be garbage-collected
fn.dir = FutureTree{} fn.tree = FutureTree{}
fn.isDir = false fn.isTree = false
} }
} }
@ -393,8 +393,8 @@ func (arch *Archiver) Save(ctx context.Context, snPath, target string, previous
start := time.Now() start := time.Now()
oldSubtree := arch.loadSubtree(ctx, previous) oldSubtree := arch.loadSubtree(ctx, previous)
fn.isDir = true fn.isTree = true
fn.dir, err = arch.SaveDir(ctx, snPath, fi, target, oldSubtree) fn.tree, err = arch.SaveDir(ctx, snPath, fi, target, oldSubtree)
if err == nil { if err == nil {
arch.CompleteItem(snItem, previous, fn.node, fn.stats, time.Since(start)) arch.CompleteItem(snItem, previous, fn.node, fn.stats, time.Since(start))
} else { } else {