aboutsummaryrefslogtreecommitdiffstats
path: root/diffcore-order.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2016-09-29 17:27:31 +0200
committerJunio C Hamano <gitster@pobox.com>2016-09-29 15:42:18 -0700
commit9ed0d8d6e6de7737fe9a658446318b86e57c6fad (patch)
tree82fdefc7bd543c99091f5b634947360f75100deb /diffcore-order.c
parentdbc540c7a5827529a3f58befc9e5b81a31ec8fab (diff)
downloadgit-9ed0d8d6e6de7737fe9a658446318b86e57c6fad.tar.gz
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>
Diffstat (limited to 'diffcore-order.c')
-rw-r--r--diffcore-order.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/diffcore-order.c b/diffcore-order.c
index 69d41f7a57..1957f822a5 100644
--- a/diffcore-order.c
+++ b/diffcore-order.c
@@ -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)