Skip to content

Commit

Permalink
feat: Updated duplicatefilefinder/main.go
Browse files Browse the repository at this point in the history
  • Loading branch information
sweep-ai[bot] committed Feb 15, 2024
1 parent 86c56d8 commit 10bcf64
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions duplicatefilefinder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,16 @@ func compareFiles(path1, path2 string) bool {
}
}
}
// First, let's measure the tails. If they're not the same length, no need to sniff further!
info1, err := os.Stat(path1)
if err != nil {
return false
}
info2, err := os.Stat(path2)
if err != nil {
return false
}
if info1.Size() != info2.Size() {
return false // Different sizes? Definitely not twins!
}
// Comparing the fur patterns... only the truly identical will pass this test!

0 comments on commit 10bcf64

Please sign in to comment.