diff options
author | Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru> | 2014-03-04 02:31:59 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-03-03 14:54:37 -0800 |
commit | 3a7fa03db97eddec274af2ef22d96fc6f486f7c0 (patch) | |
tree | 38692183c19b7d2a18d06d01609a3a20b24d4b50 /attr.c | |
parent | 9af49f822bc1e4f00b356e052f666ae7714a0399 (diff) | |
download | git-3a7fa03db97eddec274af2ef22d96fc6f486f7c0.tar.gz |
attr.c: use ALLOC_GROW() in handle_attr_line()
Signed-off-by: Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'attr.c')
-rw-r--r-- | attr.c | 7 |
1 files changed, 1 insertions, 6 deletions
@@ -338,12 +338,7 @@ static void handle_attr_line(struct attr_stack *res, a = parse_attr_line(line, src, lineno, macro_ok); if (!a) return; - if (res->alloc <= res->num_matches) { - res->alloc = alloc_nr(res->num_matches); - res->attrs = xrealloc(res->attrs, - sizeof(struct match_attr *) * - res->alloc); - } + ALLOC_GROW(res->attrs, res->num_matches + 1, res->alloc); res->attrs[res->num_matches++] = a; } |