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
@ -1573,7 +1573,7 @@ static int compare_refs(const void *a_, const void *b_)
|
||||
void ref_array_sort(struct ref_sorting *sorting, struct ref_array *array)
|
||||
{
|
||||
ref_sorting = sorting;
|
||||
qsort(array->items, array->nr, sizeof(struct ref_array_item *), compare_refs);
|
||||
QSORT(array->items, array->nr, compare_refs);
|
||||
}
|
||||
|
||||
static void append_literal(const char *cp, const char *ep, struct ref_formatting_state *state)
|
||||
|
||||
Reference in New Issue
Block a user