This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Re: black_count
- To: libstdc++@sourceware.cygnus.com
- Subject: Re: black_count
- From: Benjamin Kosnik <bkoz@cygnus.com>
- Date: Mon, 12 Jul 1999 11:36:56 -0700 (PDT)
Nathan's second patch is what went in. Thanks Nathan. .
-Benjamin
-------------
inline int
__black_count(_Rb_tree_node_base* __node, _Rb_tree_node_base* __root)
{
if (__node == 0)
return 0;
int __sum = 0;
do {
if (__node->_M_color == _S_rb_tree_black) ++__sum;
if (__node == __root) break;
__node = __node->_M_parent;
} while (1);
return __sum;
}
-Benjamin