12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- #include "private.h"
- void *lub_bintree_findnext(lub_bintree_t * this, const void *clientkey)
- {
- lub_bintree_node_t *t = this->root;
- int comp;
-
- t = this->root = lub_bintree_splay(this, t, clientkey);
- if (NULL != t) {
-
- comp = lub_bintree_compare(this, t, clientkey);
- if (comp <= 0) {
-
- t = t->right =
- lub_bintree_splay(this, t->right, clientkey);
- }
- }
- if (NULL == t) {
- return NULL;
- } else {
- return lub_bintree_getclientnode(this, t);
- }
- }
|