Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 332389
b: refs/heads/master
c: 1f05286
h: refs/heads/master
i:
  332387: 9a64d3e
v: v3
  • Loading branch information
Michel Lespinasse authored and Linus Torvalds committed Oct 9, 2012
1 parent cb22f88 commit ed8601c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 910a742d4ba863848c7283d69c21bfa779d3b9a8
refs/heads/master: 1f0528653e41ec230c60f5738820e8a544731399
14 changes: 4 additions & 10 deletions trunk/lib/rbtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,15 @@ void rb_insert_color(struct rb_node *node, struct rb_root *root)
}
}

if (parent->rb_right == node)
{
register struct rb_node *tmp;
if (parent->rb_right == node) {
__rb_rotate_left(parent, root);
tmp = parent;
parent = node;
node = tmp;
}

rb_set_black(parent);
rb_set_red(gparent);
__rb_rotate_right(gparent, root);
break;
} else {
{
register struct rb_node *uncle = gparent->rb_left;
Expand All @@ -134,18 +131,15 @@ void rb_insert_color(struct rb_node *node, struct rb_root *root)
}
}

if (parent->rb_left == node)
{
register struct rb_node *tmp;
if (parent->rb_left == node) {
__rb_rotate_right(parent, root);
tmp = parent;
parent = node;
node = tmp;
}

rb_set_black(parent);
rb_set_red(gparent);
__rb_rotate_left(gparent, root);
break;
}
}

Expand Down

0 comments on commit ed8601c

Please sign in to comment.