diff options
author | René Scharfe <l.s.r@web.de> | 2014-09-16 20:56:57 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-09-18 09:13:42 -0700 |
commit | 2756ca4347cbda05b16954cd7f445c216b935e76 (patch) | |
tree | 70afb2d44557fd05bbc0707c190c6026ab6135fd /graph.c | |
parent | 3ac22f82edec108986b2627fcd6f2a8039617a23 (diff) | |
download | git-2756ca4347cbda05b16954cd7f445c216b935e76.tar.gz |
use REALLOC_ARRAY for changing the allocation size of arraysrs/realloc-array
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'graph.c')
-rw-r--r-- | graph.c | 14 |
1 files changed, 4 insertions, 10 deletions
@@ -267,16 +267,10 @@ static void graph_ensure_capacity(struct git_graph *graph, int num_columns) graph->column_capacity *= 2; } while (graph->column_capacity < num_columns); - graph->columns = xrealloc(graph->columns, - sizeof(struct column) * - graph->column_capacity); - graph->new_columns = xrealloc(graph->new_columns, - sizeof(struct column) * - graph->column_capacity); - graph->mapping = xrealloc(graph->mapping, - sizeof(int) * 2 * graph->column_capacity); - graph->new_mapping = xrealloc(graph->new_mapping, - sizeof(int) * 2 * graph->column_capacity); + REALLOC_ARRAY(graph->columns, graph->column_capacity); + REALLOC_ARRAY(graph->new_columns, graph->column_capacity); + REALLOC_ARRAY(graph->mapping, graph->column_capacity * 2); + REALLOC_ARRAY(graph->new_mapping, graph->column_capacity * 2); } /* |