cache-tree.c: use ALLOC_GROW() in find_subtree()
Signed-off-by: Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
5cbbe13a9f
commit
bcc7a03285
@ -75,11 +75,7 @@ static struct cache_tree_sub *find_subtree(struct cache_tree *it,
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
pos = -pos-1;
|
pos = -pos-1;
|
||||||
if (it->subtree_alloc <= it->subtree_nr) {
|
ALLOC_GROW(it->down, it->subtree_nr + 1, it->subtree_alloc);
|
||||||
it->subtree_alloc = alloc_nr(it->subtree_alloc);
|
|
||||||
it->down = xrealloc(it->down, it->subtree_alloc *
|
|
||||||
sizeof(*it->down));
|
|
||||||
}
|
|
||||||
it->subtree_nr++;
|
it->subtree_nr++;
|
||||||
|
|
||||||
down = xmalloc(sizeof(*down) + pathlen + 1);
|
down = xmalloc(sizeof(*down) + pathlen + 1);
|
||||||
|
Reference in New Issue
Block a user