Skip to content

Commit 74cbf30

Browse files
authored
Merge pull request #590 from gruenich/feature/cppcheck-warnings
Simlify some if conditions to fix Cppcheck warnings
2 parents 1181b96 + 8642432 commit 74cbf30

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/decision.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ getdecisionlist(Solver *solv, Map *dm, int flags, Queue *decisionlistq)
607607
info = solv->decisionq_why.elements[ii];
608608
if (info > 0)
609609
reason = SOLVER_REASON_UNIT_RULE;
610-
else if (info <= 0)
610+
else
611611
{
612612
info = -info;
613613
reason = solv->decisionmap[vv];

src/order.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1472,9 +1472,10 @@ transaction_check_order(Transaction *trans)
14721472
p = trans->steps.elements[i];
14731473
s = pool->solvables + p;
14741474
if (s->repo != pool->installed)
1475+
{
14751476
lastins = p;
1476-
if (s->repo != pool->installed)
14771477
MAPSET(&ins, p);
1478+
}
14781479
if (havescripts(pool, p, 0))
14791480
{
14801481
MAPZERO(&seen);

src/pool.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,8 +594,7 @@ pool_createwhatprovides(Pool *pool)
594594
}
595595
else if (!pool->addedfileprovides && pool->disttype == DISTTYPE_RPM)
596596
{
597-
if (!pool->addedfileprovides)
598-
POOL_DEBUG(SOLV_DEBUG_STATS, "WARNING: pool_addfileprovides was not called, this may result in slow operation\n");
597+
POOL_DEBUG(SOLV_DEBUG_STATS, "WARNING: pool_addfileprovides was not called, this may result in slow operation\n");
599598
/* lazyly add file provides */
600599
for (i = 1; i < num; i++)
601600
{

src/rules.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3206,7 +3206,7 @@ solver_ruleclass(Solver *solv, Id rid)
32063206
{
32073207
if (rid <= 0)
32083208
return SOLVER_RULE_UNKNOWN;
3209-
if (rid > 0 && rid < solv->pkgrules_end)
3209+
if (rid < solv->pkgrules_end)
32103210
return SOLVER_RULE_PKG;
32113211
if (rid >= solv->jobrules && rid < solv->jobrules_end)
32123212
return SOLVER_RULE_JOB;

0 commit comments

Comments
 (0)