Re: [PATCH] Attempt to clarify "Augmented Trees" section of Documentation/rbtree.txt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2011-04-14 at 14:22 -0500, Rob Landley wrote:
> +This function is called when either of a node's children change.  It is not
> +called recursively: the callback function is responsible for traversing parent
> +nodes and updating their information as necessary. 

static void rb_augment_path(struct rb_node *node, rb_augment_f func, void *data)
{
        struct rb_node *parent;

up:
        func(node, data);
        parent = rb_parent(node);
        if (!parent)
                return;

        if (node == parent->rb_left && parent->rb_right)
                func(parent->rb_right, data);
        else if (parent->rb_left)
                func(parent->rb_left, data);

        node = parent;
        goto up;
}

Uhm, what?
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux