lkml.org 
[lkml]   [2012]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 3/9] rbtree: add __rb_change_child() helper function
From
Date
On Thu, 2012-08-02 at 15:34 -0700, Michel Lespinasse wrote:
> +static inline void

I would make that __always_inline, just to make sure GCC doesn't go
creative on us.

> +__rb_change_child(struct rb_node *old, struct rb_node *new,
> + struct rb_node *parent, struct rb_root *root)
> +{
> + if (parent) {
> + if (parent->rb_left == old)
> + parent->rb_left = new;
> + else
> + parent->rb_right = new;
> + } else
> + root->rb_node = new;
> +}


\
 
 \ /
  Last update: 2012-08-06 17:02    [W:0.590 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site