summaryrefslogtreecommitdiff
path: root/apt-pkg/solver3.h
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/solver3.h')
-rw-r--r--apt-pkg/solver3.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/apt-pkg/solver3.h b/apt-pkg/solver3.h
index 548c3b777..2868616de 100644
--- a/apt-pkg/solver3.h
+++ b/apt-pkg/solver3.h
@@ -114,6 +114,20 @@ class Solver
mutable std::vector<char> pkgObsolete;
bool Obsolete(pkgCache::PkgIterator pkg) const;
bool ObsoletedByNewerSourceVersion(pkgCache::VerIterator cand) const;
+ mutable std::vector<short> priorities;
+ short GetPriority(pkgCache::VerIterator ver) const
+ {
+ if (priorities[ver->ID] == 0)
+ priorities[ver->ID] = policy.GetPriority(ver);
+ return priorities[ver->ID];
+ }
+ mutable std::vector<pkgCache::VerIterator> candidates;
+ pkgCache::VerIterator GetCandidateVer(pkgCache::PkgIterator pkg) const
+ {
+ if (candidates[pkg->ID].end())
+ candidates[pkg->ID] = policy.GetCandidateVer(pkg);
+ return candidates[pkg->ID];
+ }
// \brief Heap of the remaining work.
//