Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/v9-minor'
Browse files Browse the repository at this point in the history
  • Loading branch information
scip-ci committed May 22, 2024
2 parents 7639423 + e59a34b commit 69a12c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/scip/rbtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,16 +359,17 @@ void SCIPrbtreeInsert_call(
SCIP_RBTREENODE* node /**< node to insert into the tree */
)
{
SET_PARENT(node, parent);
/* we avoid SET_PARENT here, as this would read from uninitialized memory in an attempt to preserve the color of node */
node->parent = (uintptr_t)parent | RED;
node->child[LEFT] = NULL;
node->child[RIGHT] = NULL;

if( parent == NULL )
*root = node;
else if( pos > 0 )
parent->child[LEFT] = node;
else
parent->child[RIGHT] = node;

node->child[LEFT] = NULL;
node->child[RIGHT] = NULL;
MAKE_RED(node);
rbInsertFixup(root, node);
}
2 changes: 1 addition & 1 deletion src/scip/rbtree.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ struct SCIP_RBTreeNode
*/
#define SCIP_RBTREE_HOOKS SCIP_RBTREENODE _rbtreenode

/* convenience macros that automtically cast the given arguments to SCIP_RBTREENODE */
/* convenience macros that automatically cast the given arguments to SCIP_RBTREENODE */
#define SCIPrbtreeFirst(root) SCIPrbtreeFirst_call((SCIP_RBTREENODE*)(root))
#define SCIPrbtreeLast(root) SCIPrbtreeLast_call((SCIP_RBTREENODE*)(root))
#define SCIPrbtreeSuccessor(x) SCIPrbtreeSuccessor_call((SCIP_RBTREENODE*)(x))
Expand Down

0 comments on commit 69a12c3

Please sign in to comment.