From a08f18e2a1b7e409d2d20d55749d378d4c21daa6 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 9 Feb 2026 11:42:26 +0100 Subject: solver3: Cache straight pointers in candidate cache This reduces its memory usage by half and turns it into a fast map - no destructors needed (and 0 initialization). --- apt-pkg/solver3.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'apt-pkg/solver3.h') diff --git a/apt-pkg/solver3.h b/apt-pkg/solver3.h index fc2e90b7f..4390d589b 100644 --- a/apt-pkg/solver3.h +++ b/apt-pkg/solver3.h @@ -461,12 +461,12 @@ class DependencySolver final : public Solver } // GetCandidateVer() with caching - mutable ContiguousCacheMap candidates; + mutable FastContiguousCacheMap candidates; pkgCache::VerIterator GetCandidateVer(pkgCache::PkgIterator pkg) const { - if (candidates[pkg].end()) + if (candidates[pkg] == 0) candidates[pkg] = policy.GetCandidateVer(pkg); - return candidates[pkg]; + return pkgCache::VerIterator(cache, candidates[pkg]); } // \brief Discover variables -- cgit v1.2.3-70-g09d2