summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorDmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru>2014-03-04 02:31:58 +0400
committerJunio C Hamano <gitster@pobox.com>2014-03-03 14:54:29 -0800
commit9af49f822bc1e4f00b356e052f666ae7714a0399 (patch)
tree4c830c2d38e0b9e121c672cfcd8b27e7a91caeca /dir.c
parent6647cc2626b34493e937db13e6590ee8aad0c109 (diff)
downloadgit-9af49f822bc1e4f00b356e052f666ae7714a0399.tar.gz
dir.c: use ALLOC_GROW() in create_simplify()
Signed-off-by: Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/dir.c b/dir.c
index b35b6330f8..f6c647006b 100644
--- a/dir.c
+++ b/dir.c
@@ -1329,10 +1329,7 @@ static struct path_simplify *create_simplify(const char **pathspec)
for (nr = 0 ; ; nr++) {
const char *match;
- if (nr >= alloc) {
- alloc = alloc_nr(alloc);
- simplify = xrealloc(simplify, alloc * sizeof(*simplify));
- }
+ ALLOC_GROW(simplify, nr + 1, alloc);
match = *pathspec++;
if (!match)
break;