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
@ -347,7 +347,7 @@ static void show_filemodify(struct diff_queue_struct *q,
|
||||
* Handle files below a directory first, in case they are all deleted
|
||||
* and the directory changes to a file or symlink.
|
||||
*/
|
||||
qsort(q->queue, q->nr, sizeof(q->queue[0]), depth_first);
|
||||
QSORT(q->queue, q->nr, depth_first);
|
||||
|
||||
for (i = 0; i < q->nr; i++) {
|
||||
struct diff_filespec *ospec = q->queue[i]->one;
|
||||
|
Reference in New Issue
Block a user