Skip to content

Commit

Permalink
cache-tree.c: use ALLOC_GROW() in find_subtree()
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry S. Dolzhenko <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
Dmitry S. Dolzhenko authored and gitster committed Mar 3, 2014
1 parent 5cbbe13 commit bcc7a03
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions cache-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,7 @@ static struct cache_tree_sub *find_subtree(struct cache_tree *it,
return NULL;

pos = -pos-1;
if (it->subtree_alloc <= it->subtree_nr) {
it->subtree_alloc = alloc_nr(it->subtree_alloc);
it->down = xrealloc(it->down, it->subtree_alloc *
sizeof(*it->down));
}
ALLOC_GROW(it->down, it->subtree_nr + 1, it->subtree_alloc);
it->subtree_nr++;

down = xmalloc(sizeof(*down) + pathlen + 1);
Expand Down

0 comments on commit bcc7a03

Please sign in to comment.