diff options
| author | Julian Andres Klode <julian.klode@canonical.com> | 2024-08-01 17:08:42 +0900 |
|---|---|---|
| committer | Julian Andres Klode <julian.klode@canonical.com> | 2024-11-02 10:23:15 +0100 |
| commit | 9d99322c14c44d73722bd580473abf67538b7c05 (patch) | |
| tree | b9e6aabbe07cdeffe7c5886c7095dbb545592fdf /apt-pkg/solver3.cc | |
| parent | cab40edc4040691fcadbddbdee77decf4bf20573 (diff) | |
solver3: Rename the 'dirty' bit to 'erased'
This captures the meaning better
Diffstat (limited to 'apt-pkg/solver3.cc')
| -rw-r--r-- | apt-pkg/solver3.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/apt-pkg/solver3.cc b/apt-pkg/solver3.cc index c48077c81..7aa0bd0b2 100644 --- a/apt-pkg/solver3.cc +++ b/apt-pkg/solver3.cc @@ -196,8 +196,8 @@ bool APT::Solver::Work::operator<(APT::Solver::Work const &b) const void APT::Solver::Work::Dump(pkgCache &cache) { - if (dirty) - std::cerr << "Dirty "; + if (erased) + std::cerr << "Erased "; if (optional) std::cerr << "Optional "; std::cerr << "Item (" << ssize_t(size <= solutions.size() ? size : -1) << "@" << depth << (upgrade ? "u" : "") << ") "; @@ -768,7 +768,7 @@ bool APT::Solver::Pop() // We need to remove any work that is at a higher depth. choices.pop_back(); work.erase(std::remove_if(work.begin(), work.end(), [this](Work &w) -> bool - { return w.depth > depth() || w.dirty; }), + { return w.depth > depth() || w.erased; }), work.end()); std::make_heap(work.begin(), work.end()); @@ -802,7 +802,7 @@ void APT::Solver::RescoreWorkIfNeeded() std::vector<Work> resized; for (auto &w : work) { - if (w.dirty) + if (w.erased) continue; size_t newSize = std::count_if(w.solutions.begin(), w.solutions.end(), [this](auto V) { return (*this)[V].decision != Decision::MUSTNOT; }); @@ -815,7 +815,7 @@ void APT::Solver::RescoreWorkIfNeeded() Work newWork(w); newWork.size = newSize; resized.push_back(std::move(newWork)); - w.dirty = true; + w.erased = true; } } if (unlikely(debug >= 2)) @@ -837,7 +837,7 @@ bool APT::Solver::Solve() std::pop_heap(work.begin(), work.end()); // This item has been replaced with a new one. Remove it. - if (work.back().dirty) + if (work.back().erased) { work.pop_back(); continue; |
