use DUP_ARRAY
Add a semantic patch for replace ALLOC_ARRAY+COPY_ARRAY with DUP_ARRAY to reduce code duplication and apply its results. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
d2ec87a684
commit
6e57841096
@ -1594,8 +1594,7 @@ static void compute_bloom_filters(struct write_commit_graph_context *ctx)
|
||||
_("Computing commit changed paths Bloom filters"),
|
||||
ctx->commits.nr);
|
||||
|
||||
ALLOC_ARRAY(sorted_commits, ctx->commits.nr);
|
||||
COPY_ARRAY(sorted_commits, ctx->commits.list, ctx->commits.nr);
|
||||
DUP_ARRAY(sorted_commits, ctx->commits.list, ctx->commits.nr);
|
||||
|
||||
if (ctx->order_by_pack)
|
||||
QSORT(sorted_commits, ctx->commits.nr, commit_pos_cmp);
|
||||
|
Reference in New Issue
Block a user