From 6059baeeeb19a2543fe10396d9b168eeeea23255 Mon Sep 17 00:00:00 2001 From: Jan Bader Date: Wed, 6 Dec 2023 15:08:07 +0100 Subject: [PATCH] Print distance with duplicates --- main.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index 0e9584c..4bb4fd9 100644 --- a/main.go +++ b/main.go @@ -180,24 +180,27 @@ func main() { if fileIndex == otherIndex { continue } + otherFile := filesMap.Files[otherIndex] var distance = hamming.Uint64(file.hash, otherFile.hash) if distance > 5 { continue } + if len(currentCluster) == 1 { + fmt.Println(currentCluster[0].path) + countDupeSets++ + countInstances++ + } currentCluster = append(currentCluster, otherFile) + fmt.Println(otherFile.path, distance) + countInstances++ } if len(currentCluster) <= 1 { continue } - countDupeSets++ - for _, file := range currentCluster { - countInstances++ - fmt.Println(file.path) - } fmt.Println() }