Skip to content

Commit a78f998

Browse files
authored
Merge pull request #12238 from apoelstra/2025-01--unsorted-gc
gc: replace ordered sets with unordered sets for in-memory caches
2 parents 140aee3 + 4fac767 commit a78f998

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libstore/gc.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ void LocalStore::collectGarbage(const GCOptions & options, GCResults & results)
455455
bool gcKeepOutputs = settings.gcKeepOutputs;
456456
bool gcKeepDerivations = settings.gcKeepDerivations;
457457

458-
StorePathSet roots, dead, alive;
458+
std::unordered_set<StorePath> roots, dead, alive;
459459

460460
struct Shared
461461
{
@@ -661,7 +661,7 @@ void LocalStore::collectGarbage(const GCOptions & options, GCResults & results)
661661
}
662662
};
663663

664-
std::map<StorePath, StorePathSet> referrersCache;
664+
std::unordered_map<StorePath, StorePathSet> referrersCache;
665665

666666
/* Helper function that visits all paths reachable from `start`
667667
via the referrers edges and optionally derivers and derivation

0 commit comments

Comments
 (0)