提交 1b9c53e8 编写于 作者: W Wei Yang 提交者: Linus Torvalds

lib/rbtree.c: 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.
Signed-off-by: NWei Yang <weiyang@linux.vnet.ibm.com>
Acked-by: NMichel Lespinasse <walken@google.com>
Cc: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 50835e97
...@@ -101,7 +101,7 @@ __rb_insert(struct rb_node *node, struct rb_root *root, ...@@ -101,7 +101,7 @@ __rb_insert(struct rb_node *node, struct rb_root *root,
* / \ / \ * / \ / \
* p u --> P U * p u --> P U
* / / * / /
* n N * n n
* *
* However, since g's parent might be red, and * However, since g's parent might be red, and
* 4) does not allow this, we need to recurse * 4) does not allow this, we need to recurse
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册