Re: GNode patch.

On Fri, 29 Sep 2000 jrb redhat com wrote:

> Hi,
> Here is a small patch to add g_node_insert_after.  If no one
> complains, I'd like to commit it.  However, I am a little confused by
> the behavior of g_node_insert_before.  If you pass in NULL as the
> sibling, it will effectively do a g_node_append (in fact,
> g_node_append is implemented this way.)  I guess my gut instict is to
> have g_node_insert_before do a g_node_prepend if sibling is NULL, and
> g_node_insert_after do a g_node_append if sibling is NULL.  This would
> probably break a lot of code, though.

the function itself looks ok.
on insert_before (,NULL,) doing append, LXR doesn't show any use of that
beaviour, besides glib itself.
once we have g_node_insert_after(), i'd rather change the insert_before
behaviour to do a prepend on NULL and compile that into our 2.0-changes
list, than leaving an unintuitive API.
i hope that for intentional appends, people use g_node_append() instead
of relying on the NULL behaviour of insert_before. so in theory, we
shouldn't break that much code.

> Thoughts?
> -Jonathan


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