Skip to contentSkip to conversation

rbtree: fix typo in comment of __rb_insert()

PATCH New Wei Yang 1 participant 1 message Jul 22, 2014 Library code

lore
Share & tools
lore

Wei Yang

author
#0 lore raw

PATCH 1/1 rbtree: fix typo in comment of __rb_insert()

In case 1, it passes down the BLACK color from G to p and u, and maintains the color of n. By doing so, it maintains the black height of the sub-tree.

While in the comment, it marks the color of n to BLACK. This is a typo and not consistents with the code.

This patch fixs this typo in comment.

---
 lib/rbtree.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/rbtree.c +1 -1
index 65f4eff..c16c81a 100644
@@ -101,7 +101,7 @@ __rb_insert(struct rb_node *node, struct rb_root *root,
 				 *      / \          / \
 				 *     p   u  -->   P   U
 				 *    /            /
-				 *   n            N
+				 *   n            n
 				 *
 				 * However, since g's parent might be red, and
 				 * 4) does not allow this, we need to recurse
Signature · 1 line
1.7.9.5