From 589616338f4c3195b2df8cd48533030b2a05a07e Mon Sep 17 00:00:00 2001 From: Rangi <35663410+Rangi42@users.noreply.github.com> Date: Wed, 16 Sep 2026 18:27:22 -0400 Subject: [PATCH] Remove redundant conditional check (#2099) If `nbBanks > 1` is true, then `sectionTypeInfo[type].firstBank != sectionTypeInfo[type].lastBank` must also be true, so checking whether either is true is unnecessary. (On the other hand, if `nbBanks == 1`, then we might still have `sectionTypeInfo[type].firstBank != sectionTypeInfo[type].lastBank`, since only one of many valid banks for `type` could be in use.) --- src/link/output.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/link/output.cpp b/src/link/output.cpp index 41d9dc7c..66b07133 100644 --- a/src/link/output.cpp +++ b/src/link/output.cpp @@ -532,7 +532,7 @@ static void writeMapSummary() { usedTotal == 1 ? "" : "s", static_cast(nbBanks) * sectionTypeInfo[type].size - usedTotal ); - if (sectionTypeInfo[type].firstBank != sectionTypeInfo[type].lastBank || nbBanks > 1) { + if (sectionTypeInfo[type].firstBank != sectionTypeInfo[type].lastBank) { fprintf(mapFile, " in %u bank%s", nbBanks, nbBanks == 1 ? "" : "s"); } putc('\n', mapFile);