locate the best match, does not do a final comparison */
| 19 | |
| 20 | /* locate the best match, does not do a final comparison */ |
| 21 | static struct cb_node *cb_internal_best_match(struct cb_node *p, |
| 22 | const uint8_t *k, size_t klen) |
| 23 | { |
| 24 | while (1 & (uintptr_t)p) { |
| 25 | struct cb_node *q = cb_node_of(p); |
| 26 | uint8_t c = q->byte < klen ? k[q->byte] : 0; |
| 27 | size_t direction = (1 + (q->otherbits | c)) >> 8; |
| 28 | |
| 29 | p = q->child[direction]; |
| 30 | } |
| 31 | return p; |
| 32 | } |
| 33 | |
| 34 | /* returns NULL if successful, existing cb_node if duplicate */ |
| 35 | struct cb_node *cb_insert(struct cb_tree *t, struct cb_node *node, size_t klen) |
no test coverage detected