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
@ -16,7 +16,7 @@ static int void_hashcmp(const void *a, const void *b)
|
||||
|
||||
static void sha1_array_sort(struct sha1_array *array)
|
||||
{
|
||||
qsort(array->sha1, array->nr, sizeof(*array->sha1), void_hashcmp);
|
||||
QSORT(array->sha1, array->nr, void_hashcmp);
|
||||
array->sorted = 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user