mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Refactor for better formatting
This commit is contained in:
@@ -241,11 +241,8 @@ static void placeSection(Section §ion) {
|
||||
} else if (!noLeftSpace && !noRightSpace) {
|
||||
// The free space is split in two
|
||||
// Append the new space after the original one
|
||||
bankMem.insert(
|
||||
bankMem.begin() + spaceIdx + 1,
|
||||
{.address = sectionEnd,
|
||||
.size = static_cast<uint16_t>(freeSpace.address + freeSpace.size - sectionEnd)}
|
||||
);
|
||||
uint16_t size = static_cast<uint16_t>(freeSpace.address + freeSpace.size - sectionEnd);
|
||||
bankMem.insert(bankMem.begin() + spaceIdx + 1, {.address = sectionEnd, .size = size});
|
||||
// **`freeSpace` cannot be reused from this point on, because `bankMem.insert`
|
||||
// invalidates all references to itself!**
|
||||
|
||||
|
||||
Reference in New Issue
Block a user