aboutsummaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c6
1 files changed, 1 insertions, 5 deletions
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++;