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
@ -101,7 +101,7 @@ void order_objects(const char *orderfile, obj_path_fn_t obj_path,
|
||||
objs[i].orig_order = i;
|
||||
objs[i].order = match_order(obj_path(objs[i].obj));
|
||||
}
|
||||
qsort(objs, nr, sizeof(*objs), compare_objs_order);
|
||||
QSORT(objs, nr, compare_objs_order);
|
||||
}
|
||||
|
||||
static const char *pair_pathtwo(void *obj)
|
||||
|
Reference in New Issue
Block a user