pike.git / src / post_modules / CritBit / tree_low.c

version» Context lines:

pike.git/src/post_modules/CritBit/tree_low.c:244:    }       if (CB_HAS_CHILD(node, 1)) {    b = cb_get_depth(CB_CHILD(node, 1));    }       return len + MAX(b, a);   }      CB_STATIC CB_INLINE cb_node_t cb_subtree_prefix(cb_node_t node, cb_key key) { -  cb_size size = {0,0}; +  cb_size start = {0,0}; +  +  do {    unsigned INT32 bit; -  size = cb_prefix_count(node->key.str, key.str, -  CB_MIN(node->key.len, key.len), size); +  start = cb_prefix_count(node->key.str, key.str, +  CB_MIN(node->key.len, key.len), start);    -  if (CB_S_EQ(size, key.len)) { /* key is substring */ +  if (CB_S_EQ(start, key.len)) { /* key is substring */    return node;    }    -  bit = CB_GET_BIT(key.str, size); +  bit = CB_GET_BIT(key.str, start); +  node = CB_CHILD(node, bit); +  } while (node);    -  if (CB_HAS_CHILD(node, bit)) { -  return cb_subtree_prefix(CB_CHILD(node, bit), key); -  } -  +     return NULL;   }      CB_STATIC CB_INLINE void cb_delete(struct cb_tree * tree,    const cb_key key, cb_value * val) {    cb_node_t node = cb_index(tree->root, key);       if (node && CB_HAS_VALUE(node)) {    unsigned INT32 bit;    cb_node_t t;