This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: black_count


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]