From 999f566013cf4102c07b0cdbffba419eadc7b368 Mon Sep 17 00:00:00 2001 From: "Dmitry S. Dolzhenko" Date: Tue, 4 Mar 2014 02:32:01 +0400 Subject: read-cache.c: use ALLOC_GROW() in add_index_entry() Signed-off-by: Dmitry S. Dolzhenko Signed-off-by: Junio C Hamano --- read-cache.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'read-cache.c') diff --git a/read-cache.c b/read-cache.c index 33dd676cc..40dbec92a 100644 --- a/read-cache.c +++ b/read-cache.c @@ -993,11 +993,7 @@ int add_index_entry(struct index_state *istate, struct cache_entry *ce, int opti } /* Make sure the array is big enough .. */ - if (istate->cache_nr == istate->cache_alloc) { - istate->cache_alloc = alloc_nr(istate->cache_alloc); - istate->cache = xrealloc(istate->cache, - istate->cache_alloc * sizeof(*istate->cache)); - } + ALLOC_GROW(istate->cache, istate->cache_nr + 1, istate->cache_alloc); /* Add it in.. */ istate->cache_nr++; -- cgit v1.2.1