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
@ -501,7 +501,7 @@ static void sort_ref_dir(struct ref_dir *dir)
|
||||
if (dir->sorted == dir->nr)
|
||||
return;
|
||||
|
||||
qsort(dir->entries, dir->nr, sizeof(*dir->entries), ref_entry_cmp);
|
||||
QSORT(dir->entries, dir->nr, ref_entry_cmp);
|
||||
|
||||
/* Remove any duplicates: */
|
||||
for (i = 0, j = 0; j < dir->nr; j++) {
|
||||
|
Reference in New Issue
Block a user