summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2026-01-31 21:04:02 +0100
committerJulian Andres Klode <jak@debian.org>2026-02-10 19:59:03 +0000
commit5cbf75ac2e4845b9ed1026f1d11af129e54aaf5b (patch)
tree3d86829fb8ae2d6fd0bf3ada009cb7723fbe1a0c
parent60a7d1c3be8f6c7eb697c7d5160fc560097cc70e (diff)
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)`.
-rw-r--r--apt-pkg/solver3.cc11
1 files changed, 1 insertions, 10 deletions
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});