mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-02 06:40:42 -07:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user