diff options
author | René Scharfe <l.s.r@web.de> | 2016-09-29 17:27:31 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-09-30 00:42:18 +0200 |
commit | 9ed0d8d6e6de7737fe9a658446318b86e57c6fad (patch) | |
tree | 82fdefc7bd543c99091f5b634947360f75100deb /builtin/fmt-merge-msg.c | |
parent | add QSORT (diff) | |
download | git-9ed0d8d6e6de7737fe9a658446318b86e57c6fad.tar.xz git-9ed0d8d6e6de7737fe9a658446318b86e57c6fad.zip |
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 'builtin/fmt-merge-msg.c')
-rw-r--r-- | builtin/fmt-merge-msg.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c index dc2e9e420d..4976967a96 100644 --- a/builtin/fmt-merge-msg.c +++ b/builtin/fmt-merge-msg.c @@ -315,12 +315,10 @@ static void add_people_info(struct strbuf *out, struct string_list *committers) { if (authors->nr) - qsort(authors->items, - authors->nr, sizeof(authors->items[0]), + QSORT(authors->items, authors->nr, cmp_string_list_util_as_integral); if (committers->nr) - qsort(committers->items, - committers->nr, sizeof(committers->items[0]), + QSORT(committers->items, committers->nr, cmp_string_list_util_as_integral); credit_people(out, authors, 'a'); |