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: Gabriel Dos Reis <dosreis@dptmaths.ens-cachan.fr>
- Date: 13 Jul 1999 10:19:05 +0200
- Organization: École Normale Supérieure de Cachan (France)
- References: <Pine.SUN.3.91.990712113503.19373A-100000@rtl.cygnus.com>
Benjamin Kosnik <bkoz@cygnus.com> writes:
| 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);
^^^^^^^^^
Just a stylistic note: shouldn't the above read 'while (true)'?
-- Gaby