[bind10-dev] easy part for handle non-empty node

Michal 'vorner' Vaner michal.vaner at nic.cz
Fri Jan 21 09:32:28 UTC 2011


Hello

On Fri, Jan 21, 2011 at 10:07:30AM +0800, feng wrote:
> All the enums or typedefines declared inside rbtree with different search
> policy will be different type from each other which cause the last night
> build error.

Hmm, yes, right. One way would be to exclude the enum out of the class. After
all, RBNode is outside as well.

> Since whether expose empty node or not is just a policy, and rbtree with
> different policy shouldn't necessarily be different class, 
> 
> so I propose just add two functions in rbtree like
> 
> exposeEmptyNode();
> 
> hideEmptyNode();

And the tree would have a variable for it? That seems little bit odd.

Another suggestion: Have the bool as a parameter of the find function (either
template or non-template with default). Even if it is normal parameter, the body
of function will be available whenever it is used and the parameter constant, so
the compiler should propagate and not take the extra byte and extra compares
(the find probably will be quite hot code).

It seems also easier to do it that way, than propagate trough whatever places
and having functions to set it up.

What do you think?

-- 
This email has been checked by an automatic damage possibility check system.
It can contain harmful instructions if read backwards.
Internal checker ID: lacol.cr/cte/ << tlah ohce

Michal 'vorner' Vaner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <https://lists.isc.org/pipermail/bind10-dev/attachments/20110121/5babf005/attachment.bin>


More information about the bind10-dev mailing list