tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

rb_tree_iterate(3) documentation vs. implementation

Regarding pr/46034, the manual describes one behavior for
rb_tree_iterate(3), while the implementation actually provides another.
The behavior described in the manual seems much more sensible and
useful, and I would like to change the implementation to match: see the
attached patch.


David Young    Urbana, IL    (217) 721-9981
@@ -963,13 +963,13 @@ rb_tree_iterate(struct rb_tree *rbt, voi
 #ifndef RBSMALL
                if (RB_SENTINEL_P(rbt->rbt_root))
                        return NULL;
-               return RB_NODETOITEM(rbto, rbt->rbt_minmax[direction]);
+               return RB_NODETOITEM(rbto, rbt->rbt_minmax[other]);
                self = rbt->rbt_root;
                if (RB_SENTINEL_P(self))
                        return NULL;
-               while (!RB_SENTINEL_P(self->rb_nodes[direction]))
-                       self = self->rb_nodes[direction];
+               while (!RB_SENTINEL_P(self->rb_nodes[other]))
+                       self = self->rb_nodes[other];
                return RB_NODETOITEM(rbto, self);
 #endif /* !RBSMALL */

Home | Main Index | Thread Index | Old Index