diff options
| author | Julian Andres Klode <jak@debian.org> | 2025-12-29 22:20:29 +0100 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2026-01-31 15:10:14 +0100 |
| commit | 267fd0117a057afd88bc15bfb4f4d688804a9ab4 (patch) | |
| tree | 1bda30d84ce5124571d2c97a813c4b46efb03aeb /apt-pkg/solver3.cc | |
| parent | ceca5e8d0f9e1a1c5297ed79f00ca76c61e2140c (diff) | |
Erased items do not exist anymore
Diffstat (limited to 'apt-pkg/solver3.cc')
| -rw-r--r-- | apt-pkg/solver3.cc | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/apt-pkg/solver3.cc b/apt-pkg/solver3.cc index 1532acf44..cbe318ac7 100644 --- a/apt-pkg/solver3.cc +++ b/apt-pkg/solver3.cc @@ -123,8 +123,6 @@ std::string APT::Solver::Clause::toString(pkgCache &cache, bool pretty, bool sho std::string Solver::Work::toString(pkgCache &cache) const { std::ostringstream out; - if (erased) - out << "Erased "; if (clause->optional) out << "Optional "; out << "Item (" << ssize_t(size <= clause->solutions.size() ? size : -1) << "@" << level << ") "; @@ -506,11 +504,9 @@ bool Solver::Pop() UndoOne(); // We need to remove any work that is at a higher level. - // FIXME: We should just mark the entries as erased and only do a compaction - // of the heap once we have a lot of erased entries in it. trailLim.pop_back(); work.erase(std::remove_if(work.begin(), work.end(), [this](Work &w) -> bool - { return w.level > decisionLevel() || w.erased; }), + { return w.level > decisionLevel(); }), work.end()); std::make_heap(work.begin(), work.end()); @@ -572,9 +568,6 @@ bool Solver::Solve() auto item = work.front(); std::pop_heap(work.begin(), work.end()); work.pop_back(); - // This item has been replaced with a new one. Remove it. - if (item.erased) - continue; if (std::any_of(item.clause->solutions.begin(), item.clause->solutions.end(), [this](auto ver) { return value(ver) == LiftedBool::True; })) |
