Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1416)

Issue 5431064: New convenient get_sibling() function in Red-Black tree implementation (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
7 years, 12 months ago by kwk
Modified:
7 years, 12 months ago
Reviewers:
brechtvl, bf-codereview
CC:
konrad_konradwilhelm.de
Base URL:
https://svn.blender.org/svnroot/bf-blender/trunk/blender/
Visibility:
Public.

Description

(This issue now contains a correct diff from the blender base directory) I've written a convenient function that returns the sibling of a node in the red-black tree implementation originally implemented by Joshua Leung. I want to use this get_sibling() function in the future to implement the missing removal function of the red-black tree implementation. For now the get_sibling() function just simplifies the get_uncle() function. Just like the rest of the red-black tree implementation this diff is based on Wikipedia: http://en.wikipedia.org/wiki/Red%E2%80%93black_tree#Removal

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -10 lines) Patch
source/blender/blenlib/intern/DLRB_tree.c View 1 chunk +17 lines, -10 lines 1 comment Download

Messages

Total messages: 3
kwk
7 years, 12 months ago (2011-11-24 07:21:36 UTC) #1
brechtvl
It looks ok to me, though usually such a small change would be done as ...
7 years, 12 months ago (2011-11-24 13:01:30 UTC) #2
kwk
7 years, 12 months ago (2011-11-24 14:57:51 UTC) #3
Thank you Brecht! I've added the braces you recommended and will commit my
changes now. I will try to keep my changes bigger ;)

On 2011/11/24 13:01:30, brechtvl wrote:
> It looks ok to me, though usually such a small change would be done as part of
a
> bigger one, like adding the remove function.
> 
>
http://codereview.appspot.com/5431064/diff/1/source/blender/blenlib/intern/DL...
> File source/blender/blenlib/intern/DLRB_tree.c (right):
> 
>
http://codereview.appspot.com/5431064/diff/1/source/blender/blenlib/intern/DL...
> source/blender/blenlib/intern/DLRB_tree.c:293: if (node && node->parent)
> I'd keep the { brackets here, some compilers warn about this.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b