summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--go/src/cow-dedupe/dedupe.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/go/src/cow-dedupe/dedupe.go b/go/src/cow-dedupe/dedupe.go
index 3fc2254..84f03f8 100644
--- a/go/src/cow-dedupe/dedupe.go
+++ b/go/src/cow-dedupe/dedupe.go
@@ -130,12 +130,15 @@ func getChecksums(sl statusline.StatusLine, slfmt string, basecmd []string, path
return ret
}
-func pruneSingles(key2vals map[string][]string) {
+func pruneSingles(key2vals map[string][]string) int {
+ n := 0
for key, vals := range key2vals {
if len(vals) < 2 {
delete(key2vals, key)
+ n++
}
}
+ return n
}
func dedupe(srcFile string, dupFiles []string) error {
@@ -244,13 +247,9 @@ func main() {
status.summed += len(filenames)
status.verb = "pruneSingles"
sl.Put(status.String())
- pruneSingles(checksum2filenames)
+ status.set.p += len(checksum2filenames) - 1
+ status.set.m += pruneSingles(checksum2filenames)
// And loop over the smaller, precise buckets
- if len(checksum2filenames) == 0 {
- status.set.m++
- } else {
- status.set.p += len(checksum2filenames) - 1
- }
for _, filenames := range checksum2filenames {
status.set.size = len(filenames)
status.verb = "prep"