mirror of
https://github.com/git/git.git
synced 2026-01-09 17:46:37 +00:00
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
@@ -99,7 +99,7 @@ static int verify_packfile(struct packed_git *p,
|
||||
entries[i].offset = nth_packed_object_offset(p, i);
|
||||
entries[i].nr = i;
|
||||
}
|
||||
qsort(entries, nr_objects, sizeof(*entries), compare_entries);
|
||||
QSORT(entries, nr_objects, compare_entries);
|
||||
|
||||
for (i = 0; i < nr_objects; i++) {
|
||||
void *data;
|
||||
|
||||
Reference in New Issue
Block a user