use QSORT
Apply the semantic patch contrib/coccinelle/qsort.cocci to the code base, replacing calls of qsort(3) with QSORT. The resulting code is shorter and supports empty arrays with NULL pointers. Signed-off-by: Rene 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
dbc540c7a5
commit
9ed0d8d6e6
@ -580,7 +580,7 @@ void diffcore_rename(struct diff_options *options)
|
||||
stop_progress(&progress);
|
||||
|
||||
/* cost matrix sorted by most to least similar pair */
|
||||
qsort(mx, dst_cnt * NUM_CANDIDATE_PER_DST, sizeof(*mx), score_compare);
|
||||
QSORT(mx, dst_cnt * NUM_CANDIDATE_PER_DST, score_compare);
|
||||
|
||||
rename_count += find_renames(mx, dst_cnt, minimum_score, 0);
|
||||
if (detect_rename == DIFF_DETECT_COPY)
|
||||
|
Reference in New Issue
Block a user