mirror of
https://github.com/restic/restic.git
synced 2025-01-03 05:35:43 +00:00
Collapse a few boolean operations
This commit is contained in:
parent
49b6aac3fa
commit
460e2ffbf6
3 changed files with 4 additions and 14 deletions
|
@ -1417,11 +1417,7 @@ func linksEqual(source, dest map[uint64][]string) bool {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(dest) != 0 {
|
return len(dest) == 0
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func linkEqual(source, dest []string) bool {
|
func linkEqual(source, dest []string) bool {
|
||||||
|
|
|
@ -1458,10 +1458,7 @@ func TestArchiverSnapshotSelect(t *testing.T) {
|
||||||
"other": TestFile{Content: "another file"},
|
"other": TestFile{Content: "another file"},
|
||||||
},
|
},
|
||||||
selFn: func(item string, fi os.FileInfo) bool {
|
selFn: func(item string, fi os.FileInfo) bool {
|
||||||
if filepath.Ext(item) == ".txt" {
|
return filepath.Ext(item) != ".txt"
|
||||||
return false
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -1485,10 +1482,7 @@ func TestArchiverSnapshotSelect(t *testing.T) {
|
||||||
"other": TestFile{Content: "another file"},
|
"other": TestFile{Content: "another file"},
|
||||||
},
|
},
|
||||||
selFn: func(item string, fi os.FileInfo) bool {
|
selFn: func(item string, fi os.FileInfo) bool {
|
||||||
if filepath.Base(item) == "subdir" {
|
return filepath.Base(item) != "subdir"
|
||||||
return false
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -84,7 +84,7 @@ func walk(ctx context.Context, repo restic.TreeLoader, prefix string, parentTree
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if ignore == false {
|
if !ignore {
|
||||||
allNodesIgnored = false
|
allNodesIgnored = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue