[PATCH 1/2] erofs-utils: dump: remove redundant conditional branch in filesize distribution

Nithurshen nithurshen.dev at gmail.com
Fri Mar 6 19:57:16 AEDT 2026


The logic for printing the filesize distribution chart in `dump.erofs` contained an `else if (i <= 6)` branch that executed the exact same sprintf statement as the fallback `else` branch.

Remove the redundant `else if` condition to clean up the code and simplify the logic.

Signed-off-by: Nithurshen <nithurshen.dev at gmail.com>
---
 dump/main.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/dump/main.c b/dump/main.c
index 567cff6..78c50d5 100644
--- a/dump/main.c
+++ b/dump/main.c
@@ -522,10 +522,7 @@ static void erofsdump_filesize_distribution(const char *title,
 		memset(col4, 0, sizeof(col4));
 		if (i == len - 1)
 			sprintf(col1, "%6d ..", lowerbound);
-		else if (i <= 6)
-			sprintf(col1, "%6d .. %-6d", lowerbound, upperbound);
 		else
-
 			sprintf(col1, "%6d .. %-6d", lowerbound, upperbound);
 		col2 = file_counts[i];
 		if (stats.file_category_stat[EROFS_FT_REG_FILE])
-- 
2.51.0



More information about the Linux-erofs mailing list