Use comparison function for end/max_end
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 2 Jun 2011 02:31:16 +0000 (22:31 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 2 Jun 2011 02:31:16 +0000 (22:31 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
urcu-rbtree.c

index d225729cfd5260ed6d6ca14932fdbc4cce338718..b2982bb4f442e1fbe31fcb95e21df7faf5061c2b 100644 (file)
@@ -381,12 +381,16 @@ void populate_node_end(struct rcu_rbtree *rbtree, struct rcu_rbtree_node *node,
                assert(node);
                assert(!rcu_rbtree_is_nil(rbtree, node));
                max_end = node->end;
-               if (!rcu_rbtree_is_nil(rbtree, node->_right))
-                       max_end = max(max_end, node->_right->max_end);
-               if (!rcu_rbtree_is_nil(rbtree, node->_left))
-                       max_end = max(max_end, node->_left->max_end);
+               if (!rcu_rbtree_is_nil(rbtree, node->_right)) {
+                       if (rbtree->comp(max_end, node->_right->max_end) < 0)
+                               max_end = node->_right->max_end;
+               }
+               if (!rcu_rbtree_is_nil(rbtree, node->_left)) {
+                       if (rbtree->comp(max_end, node->_left->max_end) < 0)
+                               max_end = node->_left->max_end;
+               }
 
-               if (max_end != node->max_end) {
+               if (rbtree->comp(max_end, node->max_end) != 0) {
                        if (prev && copy_parents) {
                                node = dup_decay_node(rbtree, node);
                                if (get_pos(prev) == IS_RIGHT)
This page took 0.027704 seconds and 4 git commands to generate.