Skip to content

Commit

Permalink
Return early if too small to be deduped
Browse files Browse the repository at this point in the history
  • Loading branch information
lflare committed Dec 25, 2021
1 parent 617e5ce commit e77dbea
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ func rewrite(path string, info os.FileInfo, err error) error {
return nil
}

// Return early if too small to actually balance
if info.Size() < BLOCKSIZE {
return nil
}

// Open file
f, err := os.OpenFile(path, os.O_RDWR, info.Mode().Perm())
if err != nil {
Expand Down

0 comments on commit e77dbea

Please sign in to comment.