From 8f4c09bb58b047a73328f935b9abeb4fe0b03ae1 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 6 Feb 2025 12:28:57 +0100 Subject: solver3: Add const where helpful operator[] is a bit annoying here, but oh well, what can we do? --- apt-pkg/solver3.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'apt-pkg/solver3.cc') diff --git a/apt-pkg/solver3.cc b/apt-pkg/solver3.cc index f402d1ba3..36bdd9aeb 100644 --- a/apt-pkg/solver3.cc +++ b/apt-pkg/solver3.cc @@ -229,7 +229,7 @@ bool APT::Solver::Work::operator<(APT::Solver::Work const &b) const return false; } -std::string APT::Solver::Clause::toString(pkgCache &cache) +std::string APT::Solver::Clause::toString(pkgCache &cache) const { std::string out; if (auto Pkg = reason.Pkg(cache); not Pkg.end()) @@ -242,7 +242,7 @@ std::string APT::Solver::Clause::toString(pkgCache &cache) return out; } -std::string APT::Solver::Work::toString(pkgCache &cache) +std::string APT::Solver::Work::toString(pkgCache &cache) const { std::ostringstream out; if (erased) @@ -255,7 +255,7 @@ std::string APT::Solver::Work::toString(pkgCache &cache) } // Prints an implication graph part of the form A -> B -> C, possibly with "not" -std::string APT::Solver::WhyStr(Var reason) +std::string APT::Solver::WhyStr(Var reason) const { std::vector out; @@ -997,7 +997,7 @@ bool APT::Solver::FromDepCache(pkgDepCache &depcache) return Propagate(); } -bool APT::Solver::ToDepCache(pkgDepCache &depcache) +bool APT::Solver::ToDepCache(pkgDepCache &depcache) const { pkgDepCache::ActionGroup group(depcache); for (auto P = cache.PkgBegin(); not P.end(); P++) -- cgit v1.2.3-70-g09d2