diff options
author | René Scharfe <l.s.r@web.de> | 2023-01-01 22:16:48 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-01-09 13:28:36 +0900 |
commit | 6e578410960d9ceb35ec98ad4b6fc711f1a9c85c (patch) | |
tree | eda5b7fabcc2394e6b9b3f021d8e03a0833273fe /commit-reach.c | |
parent | d2ec87a684e2f9cd1f0c653620a00d74ad5ee2ce (diff) | |
download | git-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-reach.c')
-rw-r--r-- | commit-reach.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/commit-reach.c b/commit-reach.c index c226ee3da4..2e33c599a8 100644 --- a/commit-reach.c +++ b/commit-reach.c @@ -245,8 +245,7 @@ static int remove_redundant_with_gen(struct repository *r, * min_gen_pos points to the current position within 'array' * that is not yet known to be STALE. */ - ALLOC_ARRAY(sorted, cnt); - COPY_ARRAY(sorted, array, cnt); + DUP_ARRAY(sorted, array, cnt); QSORT(sorted, cnt, compare_commits_by_gen); min_generation = commit_graph_generation(sorted[0]); |