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:
René Scharfe
2023-01-01 22:16:48 +01:00
committed by Junio C Hamano
parent d2ec87a684
commit 6e57841096
8 changed files with 15 additions and 16 deletions

View File

@ -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]);