Skip to content

Commit da242e6

Browse files
committed
Merge branch 'easy-cppcheck-fixes' into 'v91-bugfix'
some easy cppcheck fixes See merge request integer/scip!3439
2 parents de99f7a + bae3e97 commit da242e6

File tree

3 files changed

+9
-18
lines changed

3 files changed

+9
-18
lines changed

src/scip/presol_tworowbnd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,8 +592,8 @@ SCIP_RETCODE transformAndSolve(
592592

593593
SCIP_Real newbnd;
594594

595-
assert(!swaprow1 || (swaprow1 && !SCIPisInfinity(scip, SCIPmatrixGetRowRhs(matrix, row1idx))));
596-
assert(!swaprow2 || (swaprow2 && !SCIPisInfinity(scip, SCIPmatrixGetRowRhs(matrix, row2idx))));
595+
assert(!swaprow1 || !SCIPisInfinity(scip, SCIPmatrixGetRowRhs(matrix, row1idx)));
596+
assert(!swaprow2 || !SCIPisInfinity(scip, SCIPmatrixGetRowRhs(matrix, row2idx)));
597597

598598
row1len = SCIPmatrixGetRowNNonzs(matrix, row1idx);
599599
row2len = SCIPmatrixGetRowNNonzs(matrix, row2idx);

src/scip/symmetry_graph.c

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -824,21 +824,10 @@ int compareVarsSignedPerm(
824824
assert(var1 != NULL);
825825
assert(var2 != NULL);
826826

827-
/* use SCIP's comparison functions if available */
828-
if( scip == NULL )
829-
{
830-
if( SCIPvarGetType(var1) < SCIPvarGetType(var2) )
831-
return -1;
832-
if( SCIPvarGetType(var1) > SCIPvarGetType(var2) )
833-
return 1;
834-
}
835-
else
836-
{
837-
if( SCIPvarGetType(var1) < SCIPvarGetType(var2) )
838-
return -1;
839-
if( SCIPvarGetType(var1) > SCIPvarGetType(var2) )
840-
return 1;
841-
}
827+
if( SCIPvarGetType(var1) < SCIPvarGetType(var2) )
828+
return -1;
829+
if( SCIPvarGetType(var1) > SCIPvarGetType(var2) )
830+
return 1;
842831

843832
obj1 = isneg1 ? -SCIPvarGetObj(var1) : SCIPvarGetObj(var1);
844833
obj2 = isneg2 ? -SCIPvarGetObj(var2) : SCIPvarGetObj(var2);

src/scip/tree.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6407,6 +6407,7 @@ SCIP_RETCODE treeCreateProbingNode(
64076407

64086408
/* get the current node */
64096409
currentnode = SCIPtreeGetCurrentNode(tree);
6410+
assert(currentnode != NULL);
64106411
assert(SCIPnodeGetType(currentnode) == SCIP_NODETYPE_FOCUSNODE
64116412
|| SCIPnodeGetType(currentnode) == SCIP_NODETYPE_REFOCUSNODE
64126413
|| SCIPnodeGetType(currentnode) == SCIP_NODETYPE_PROBINGNODE);
@@ -6720,8 +6721,9 @@ SCIP_RETCODE SCIPtreeMarkProbingNodeHasLP(
67206721

67216722
/* get current probing node */
67226723
node = SCIPtreeGetCurrentNode(tree);
6724+
assert(node != NULL);
67236725
assert(SCIPnodeGetType(node) == SCIP_NODETYPE_PROBINGNODE);
6724-
assert(node != NULL && node->data.probingnode != NULL);
6726+
assert(node->data.probingnode != NULL);
67256727

67266728
/* update LP information in probingnode data */
67276729
/* cppcheck-suppress nullPointer */

0 commit comments

Comments
 (0)