remove unused variable and make sure to check that the current

generation is not the one we are deleting
This commit is contained in:
Matthew O'Gorman 2018-03-01 22:22:02 -05:00
parent 12fe2249e1
commit 3c16044cb0

View file

@ -159,7 +159,6 @@ void deleteGenerations(const Path & profile, const std::set<unsigned int> & gens
void deleteGenerationsGreaterThan(const Path & profile, int max, bool dryRun)
{
int max_keep = 0;
PathLocks lock;
lockProfile(lock, profile);
@ -172,7 +171,8 @@ void deleteGenerationsGreaterThan(const Path & profile, int max, bool dryRun)
max--;
continue;
}
deleteGeneration2(profile, i->number, dryRun);
if (i->number != curGen)
deleteGeneration2(profile, i->number, dryRun);
}
}