Skip to content

Commit

Permalink
Minor code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed Jul 1, 2019
1 parent cb03dc3 commit 8844397
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/savegame.cpp
Expand Up @@ -65,13 +65,13 @@ bool save_game_exists(std::string name, compression::format compressed)

void clean_saves(const std::string& label)
{
std::vector<save_info> games = get_saves_list();
std::string prefix = label + "-" + _("Auto-Save");
const std::string prefix = label + "-" + _("Auto-Save");
LOG_SAVE << "Cleaning saves with prefix '" << prefix << "'\n";
for (std::vector<save_info>::iterator i = games.begin(); i != games.end(); ++i) {
if (i->name().compare(0, prefix.length(), prefix) == 0) {
LOG_SAVE << "Deleting savegame '" << i->name() << "'\n";
delete_game(i->name());

for(const auto& save : get_saves_list()) {
if(save.name().compare(0, prefix.length(), prefix) == 0) {
LOG_SAVE << "Deleting savegame '" << save.name() << "'\n";
delete_game(save.name());
}
}
}
Expand Down

0 comments on commit 8844397

Please sign in to comment.