From 5cbf75ac2e4845b9ed1026f1d11af129e54aaf5b Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sat, 31 Jan 2026 21:04:02 +0100 Subject: solver3: Remove dead code It used to be that we reached conflict clauses from the Solve() loop, however that is no longer the case, so remove the else branch, and turn the `else if (item.clause->optional)` into a new `else` with an `assert(item.clause->optional)`. --- apt-pkg/solver3.cc | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/solver3.cc b/apt-pkg/solver3.cc index e4449339e..ca32cd1d4 100644 --- a/apt-pkg/solver3.cc +++ b/apt-pkg/solver3.cc @@ -596,20 +596,11 @@ bool Solver::Solve() << "(try it: " << candidate->toString(cache) << ")\n"; must_succeed(Assume(*candidate, item.clause)); } - else if (item.clause->optional) - { - if (unlikely(debug >= 1)) - std::cerr << item.toString(cache) << "\n"; - } else { - abort(); + assert(item.clause->optional); if (unlikely(debug >= 1)) std::cerr << item.toString(cache) << "\n"; - // Enqueue produces the right error message for us here, given that reason has been assigned true already... - assert(value(item.clause->reason) == LiftedBool::True); - must_succeed(not Enqueue(~item.clause->reason, item.clause)); - assert(value(item.clause->reason) == LiftedBool::True); } // Must push to trail after any Assume() above. trail.push_back(Trail{Var(), item}); -- cgit v1.2.3-70-g09d2