Merge pull request #9041 from trofi/profiles-sign

src/libstore/profiles.cc: fix comparison of sign difference
This commit is contained in:
Théophane Hufschmitt 2023-09-26 07:50:17 +02:00 committed by GitHub
commit 1da1642527
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -183,7 +183,7 @@ void deleteGenerationsGreaterThan(const Path & profile, GenerationNumber max, bo
iterDropUntil(gens, i, [&](auto & g) { return g.number == curGen; }); iterDropUntil(gens, i, [&](auto & g) { return g.number == curGen; });
// Skip over `max` generations, preserving them // Skip over `max` generations, preserving them
for (auto keep = 0; i != gens.rend() && keep < max; ++i, ++keep); for (GenerationNumber keep = 0; i != gens.rend() && keep < max; ++i, ++keep);
// Delete the rest // Delete the rest
for (; i != gens.rend(); ++i) for (; i != gens.rend(); ++i)