Merge both "single-side" code paths in placeSection

This commit is contained in:
ISSOtm
2020-02-03 20:19:30 +01:00
parent fd32b2252f
commit 4d2379b3df

View File

@@ -281,13 +281,12 @@ static void placeSection(struct Section *section)
/* Set the original space's new parameters */
freeSpace->size = section->org - freeSpace->address;
/* address is unmodified */
} else if (noLeftSpace) {
/* The free space is only moved and resized */
freeSpace->address += section->size;
freeSpace->size -= section->size;
} else {
/* The free space is only resized */
/* The amount of free spaces doesn't change: resize! */
freeSpace->size -= section->size;
if (noLeftSpace)
/* The free space is moved *and* resized */
freeSpace->address += section->size;
}
return;
}