Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1293980
| From | Tao Zhou <t1zhou@163.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] rbtree: correct comments about rotation operation |
| Date | 2015-12-17 16:40 +0100 |
| Message-ID | <qGIOR-1gS-5@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
The rotation operation is symmetric. So the comments about rotation operation need to be corrected. Signed-off-by: Tao Zhou <t1zhou@163.com> --- lib/rbtree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rbtree.c b/lib/rbtree.c index 1356454..750cfa8 100644 --- a/lib/rbtree.c +++ b/lib/rbtree.c @@ -365,7 +365,7 @@ ____rb_erase_color(struct rb_node *parent, struct rb_root *root, } break; } - /* Case 3 - right rotate at sibling */ + /* Case 3 - left rotate at sibling */ tmp1 = tmp2->rb_left; WRITE_ONCE(sibling->rb_right, tmp1); WRITE_ONCE(tmp2->rb_left, sibling); @@ -377,7 +377,7 @@ ____rb_erase_color(struct rb_node *parent, struct rb_root *root, tmp1 = sibling; sibling = tmp2; } - /* Case 4 - left rotate at parent + color flips */ + /* Case 4 - right rotate at parent + color flips */ tmp2 = sibling->rb_right; WRITE_ONCE(parent->rb_left, tmp2); WRITE_ONCE(sibling->rb_right, parent); -- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH] rbtree: correct comments about rotation operation Tao Zhou <t1zhou@163.com> - 2015-12-17 16:40 +0100
csiph-web