Subject: Re: CVS commit: src/sys/lib/libkern
To: None <source-changes@NetBSD.org>
From: Joerg Sonnenberger <joerg@britannica.bec.de>
List: source-changes
Date: 11/22/2007 03:49:51
On Thu, Nov 22, 2007 at 11:31:44AM +0900, YAMAMOTO Takashi wrote:
> > Module Name: src
> > Committed By: matt
> > Date: Wed Nov 21 16:42:51 UTC 2007
> >
> > Modified Files:
> > src/sys/lib/libkern: rb.c rb.h
> >
> > Log Message:
> > Make rb_tree_insert_node return true/false whether the node was inserted
> > or not.
> >
> >
> > To generate a diff of this commit:
> > cvs rdiff -r1.13 -r1.14 src/sys/lib/libkern/rb.c
> > cvs rdiff -r1.8 -r1.9 src/sys/lib/libkern/rb.h
> >
> > Please note that diffs are not public domain; they are subject to the
> > copyright notices on the relevant files.
>
> how about returning the duplicate node rather than a boolean?
I don't think that is a common use case. E.g. normally insert is used to
prepare a new node and a duplicate entry is an actual error. I can't
think of a good example where you want to replace the existing entry and
didn't check for that earlier.
Joerg