]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
decision.c: Simplify else condition
authorChristoph Grüninger <foss@grueninger.de>
Wed, 14 May 2025 19:16:19 +0000 (21:16 +0200)
committerChristoph Grüninger <foss@grueninger.de>
Wed, 14 May 2025 19:16:19 +0000 (21:16 +0200)
Found by Cppcheck: "Expression is always true because
'else if' condition is opposite to previous condition
at line 608." (multiCondition)

src/decision.c

index 353b80c8aebbf8b6878dfe08230b5aa4f3466364..d5b1f3b5d1694eb5699aee03e5538143ca3c451f 100644 (file)
@@ -607,7 +607,7 @@ getdecisionlist(Solver *solv, Map *dm, int flags, Queue *decisionlistq)
       info = solv->decisionq_why.elements[ii];
       if (info > 0)
        reason = SOLVER_REASON_UNIT_RULE;
-      else if (info <= 0)
+      else
        {
          info = -info;
          reason = solv->decisionmap[vv];