cfg: optimize saving config (#714)

## Link to GitHub Issue or related Pull Request, if one exists
#0

## Description of change
Save config xml once instead of ~33 times

## Testing
xml is still saved properly
This commit is contained in:
drmext
2026-05-29 16:09:02 +00:00
committed by GitHub
parent 89602cfcab
commit b558df3340
3 changed files with 19 additions and 5 deletions
+3 -1
View File
@@ -154,12 +154,14 @@ namespace overlay::windows {
// add games to the config and window
auto &config = ::Config::getInstance();
for (auto &game : games_list) {
config.addGame(game);
config.addGame(game, /* save */ false);
if (!config.getStatus()) {
log_warning("config", "failure adding game: {}", game.getGameName());
}
}
// single flush in place of ~33 redundant writes during the loop above
config.save();
// read card numbers
read_card();