diff options
author | Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru> | 2014-03-04 02:32:01 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-03-03 14:54:54 -0800 |
commit | 999f566013cf4102c07b0cdbffba419eadc7b368 (patch) | |
tree | fcf73e0251ec4f82d7191c6e34d0b7bd8b4a0a8e /read-cache.c | |
parent | 66d9f38bc72b4415046704697f3d3898afbce73a (diff) | |
download | git-999f566013cf4102c07b0cdbffba419eadc7b368.tar.gz |
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>
Diffstat (limited to 'read-cache.c')
-rw-r--r-- | read-cache.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/read-cache.c b/read-cache.c index 33dd676ccb..40dbec92ac 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++; |