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
@ -315,12 +315,10 @@ static void add_people_info(struct strbuf *out,
|
||||
struct string_list *committers)
|
||||
{
|
||||
if (authors->nr)
|
||||
qsort(authors->items,
|
||||
authors->nr, sizeof(authors->items[0]),
|
||||
QSORT(authors->items, authors->nr,
|
||||
cmp_string_list_util_as_integral);
|
||||
if (committers->nr)
|
||||
qsort(committers->items,
|
||||
committers->nr, sizeof(committers->items[0]),
|
||||
QSORT(committers->items, committers->nr,
|
||||
cmp_string_list_util_as_integral);
|
||||
|
||||
credit_people(out, authors, 'a');
|
||||
|
Reference in New Issue
Block a user