summaryrefslogtreecommitdiff
path: root/commit-graph.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2023-01-01 22:16:48 +0100
committerJunio C Hamano <gitster@pobox.com>2023-01-09 13:28:36 +0900
commit6e578410960d9ceb35ec98ad4b6fc711f1a9c85c (patch)
treeeda5b7fabcc2394e6b9b3f021d8e03a0833273fe /commit-graph.c
parentd2ec87a684e2f9cd1f0c653620a00d74ad5ee2ce (diff)
downloadgit-6e578410960d9ceb35ec98ad4b6fc711f1a9c85c.tar.gz
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>
Diffstat (limited to 'commit-graph.c')
-rw-r--r--commit-graph.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/commit-graph.c b/commit-graph.c
index a7d8755932..c11b59f28b 100644
--- a/commit-graph.c
+++ b/commit-graph.c
@@ -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);