Keep more non-declaration initialization within the for loop clause

This commit is contained in:
Rangi42
2026-04-19 22:01:56 +02:00
parent 71dfab3365
commit 12186fdccc
3 changed files with 8 additions and 13 deletions
+1 -2
View File
@@ -175,8 +175,7 @@ void reverse() {
// Pick the smallest width that will result in a landscape-aspect rectangular image.
// Thus a prime number of tiles will result in a horizontal row.
// This avoids redundancy with `-r 1` which results in a vertical column.
width = static_cast<size_t>(ceil(sqrt(mapSize)));
for (; width < mapSize; ++width) {
for (width = static_cast<size_t>(ceil(sqrt(mapSize))); width < mapSize; ++width) {
if (mapSize % width == 0) {
break;
}