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
@ -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]);
|
||||
|
||||
|
Reference in New Issue
Block a user