read-cache.c: use ALLOC_GROW() in add_index_entry()
Signed-off-by: Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Dmitry S. Dolzhenko committed
Mar 4, 2014 at 02:32 UTC
999f566013cf4102c07b0cdbffba419eadc7b368
1 file changed
+1
-5
read-cache.c
+1
-5
@@ -993,11 +993,7 @@ int add_index_entry(struct index_state *istate, struct cache_entry *ce, int opti
993
}
994
995
/* Make sure the array is big enough .. */
996
- if (istate->cache_nr == istate->cache_alloc) {
997
- istate->cache_alloc = alloc_nr(istate->cache_alloc);
998
- istate->cache = xrealloc(istate->cache,
999
- istate->cache_alloc * sizeof(*istate->cache));
1000
- }
996
+ ALLOC_GROW(istate->cache, istate->cache_nr + 1, istate->cache_alloc);
997
998
/* Add it in.. */
999
istate->cache_nr++;