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
@ -812,7 +812,7 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args,
|
||||
int agent_len;
|
||||
|
||||
sort_ref_list(&ref, ref_compare_name);
|
||||
qsort(sought, nr_sought, sizeof(*sought), cmp_ref_by_name);
|
||||
QSORT(sought, nr_sought, cmp_ref_by_name);
|
||||
|
||||
if ((args->depth > 0 || is_repository_shallow()) && !server_supports("shallow"))
|
||||
die("Server does not support shallow clients");
|
||||
|
||||
Reference in New Issue
Block a user