third-party/CART/cart.cpp
static int check_prefix(const cart_node *n, const unsigned char *key, int key_len, int depth) {
    int max_cmp = min(min(n->partial_len, MAX_PREFIX_LEN), key_len - depth);
    int idx;
    for (idx=0; idx < max_cmp; idx++) {
        if (n->partial[idx] != key[depth+idx])
            return idx;
    }
    return idx;
}
/**
 * Returns the number of prefix characters shared between
 * the key and node.
 */
Returns the number of prefix characters shared between
the key and node.
Returns the number of prefix characters shared between the key and node .
static int check_prefix(const cart_node *n, const unsigned char *key, int key_len, int depth) {
    int max_cmp = min(min(n->partial_len, MAX_PREFIX_LEN), key_len - depth);
    int idx;
    for (idx=0; idx < max_cmp; idx++) {
        if (n->partial[idx] != key[depth+idx])
            return idx;
    }
    return idx;
}
static int check_prefix ( const cart_node * n , const unsigned char * key , int key_len , int depth ) { int max_cmp = min ( min ( n -> partial_len , MAX_PREFIX_LEN ) , key_len - depth ) ; int idx ; for ( idx = 0 ; idx < max_cmp ; idx ++ ) { if ( n -> partial [ idx ] != key [ depth + idx ] ) return idx ; } return idx ; }
Returns the number of prefix characters shared between
 the key and node.
Returns the number of prefix characters shared between the key and node .