From 9ed0d8d6e6de7737fe9a658446318b86e57c6fad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Thu, 29 Sep 2016 17:27:31 +0200 Subject: 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 Signed-off-by: Junio C Hamano --- diffcore-delta.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'diffcore-delta.c') diff --git a/diffcore-delta.c b/diffcore-delta.c index 4159748a70..2ebedb32d1 100644 --- a/diffcore-delta.c +++ b/diffcore-delta.c @@ -158,10 +158,7 @@ static struct spanhash_top *hash_chars(struct diff_filespec *one) n = 0; accum1 = accum2 = 0; } - qsort(hash->data, - 1ul << hash->alloc_log2, - sizeof(hash->data[0]), - spanhash_cmp); + QSORT(hash->data, 1ul << hash->alloc_log2, spanhash_cmp); return hash; } -- cgit v1.2.3