minor optimize

This commit is contained in:
Nick Peng
2019-08-16 20:13:09 +08:00
parent 6291c17d6a
commit 87f04571b1
14 changed files with 127 additions and 80 deletions

View File

@@ -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);