minor optimize
This commit is contained in:
@@ -390,6 +390,10 @@ art_leaf* art_maximum(art_tree *t) {
|
||||
|
||||
static art_leaf* make_leaf(const unsigned char *key, int key_len, void *value) {
|
||||
art_leaf *l = (art_leaf*)calloc(1, sizeof(art_leaf)+key_len+1);
|
||||
if (l == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
l->value = value;
|
||||
l->key_len = key_len;
|
||||
memcpy(l->key, key, key_len);
|
||||
|
||||
@@ -281,7 +281,7 @@ static radix_node_t
|
||||
*radix_search_best2(radix_tree_t *radix, prefix_t *prefix, int inclusive)
|
||||
{
|
||||
radix_node_t *node;
|
||||
radix_node_t *stack[RADIX_MAXBITS + 1];
|
||||
radix_node_t *stack[RADIX_MAXBITS + 1] = {0};
|
||||
unsigned char *addr;
|
||||
unsigned int bitlen;
|
||||
int cnt = 0;
|
||||
|
||||
Reference in New Issue
Block a user