From f5b2108a5920ad28f83291d88a0049baa95a5b88 Mon Sep 17 00:00:00 2001 From: Unbewohnte Date: Sun, 9 Jan 2022 00:35:28 +0300 Subject: [PATCH] Fixed EMPTY files to be considered as DUPLICATE --- src/broom.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/broom.cpp b/src/broom.cpp index 9338002..7c21157 100644 --- a/src/broom.cpp +++ b/src/broom.cpp @@ -215,8 +215,12 @@ uintmax_t Broom::m_find_duplicates() { // mark duplicate entries - for (entry::Entry& duplicate_entry : m_tracked_entries) { - duplicate_entry.group = group::DUPLICATE; + for (entry::Entry& entry : m_tracked_entries) { + if (entry.group == group::EMPTY) { + // do not mess up grouping + continue; + } + entry.group = group::DUPLICATE; } return m_tracked_entries.size(); @@ -258,6 +262,7 @@ uintmax_t Broom::m_find_empty_files() { uintmax_t found_empty_files = 0; for (entry::Entry& entry : m_tracked_entries) { if (entry.filesize == 0) { + // empty files can`t be considered as duplicates. assign a group entry.group = group::EMPTY; found_empty_files++; }