diff options
author | Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru> | 2014-03-03 23:32:01 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-03-03 23:54:54 +0100 |
commit | 999f566013cf4102c07b0cdbffba419eadc7b368 (patch) | |
tree | fcf73e0251ec4f82d7191c6e34d0b7bd8b4a0a8e /read-cache.c | |
parent | builtin/mktree.c: use ALLOC_GROW() in append_to_tree() (diff) | |
download | git-999f566013cf4102c07b0cdbffba419eadc7b368.tar.xz git-999f566013cf4102c07b0cdbffba419eadc7b368.zip |
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 '')
-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++; |