Simplify the SRAM's representation in NDSCartArgs (#1914)

* Simplify the SRAM's representation in  `NDSCartArgs`

- I overthought this one.
- I could've just checked `args && args->SRAM`, but then some other poor bastard might make this mistake.
- Don't mix `pair`, `optional`, and `unique_ptr` all at once, kids.

* Fix a `nullptr` read
This commit is contained in:
Jesse Talavera
2023-12-15 08:56:10 -05:00
committed by GitHub
parent 24c402af51
commit e1821d0023
3 changed files with 16 additions and 6 deletions

View File

@ -1316,8 +1316,8 @@ bool LoadROM(EmuThread* emuthread, QStringList filepath, bool reset)
// the ROM is homebrew or not.
// So this is the card we *would* load if the ROM were homebrew.
.SDCard = GetDLDISDCardArgs(),
.SRAM = std::make_pair(std::move(savedata), savelen),
.SRAM = std::move(savedata),
.SRAMLength = savelen,
};
auto cart = NDSCart::ParseROM(std::move(filedata), filelen, std::move(cartargs));