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-29 15:42:18 -0700 |
commit | 9ed0d8d6e6de7737fe9a658446318b86e57c6fad (patch) | |
tree | 82fdefc7bd543c99091f5b634947360f75100deb /fast-import.c | |
parent | dbc540c7a5827529a3f58befc9e5b81a31ec8fab (diff) | |
download | git-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 'fast-import.c')
-rw-r--r-- | fast-import.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fast-import.c b/fast-import.c index bf53ac95da..cb545d7df5 100644 --- a/fast-import.c +++ b/fast-import.c @@ -1460,9 +1460,9 @@ static void mktree(struct tree_content *t, int v, struct strbuf *b) unsigned int i; if (!v) - qsort(t->entries,t->entry_count,sizeof(t->entries[0]),tecmp0); + QSORT(t->entries, t->entry_count, tecmp0); else - qsort(t->entries,t->entry_count,sizeof(t->entries[0]),tecmp1); + QSORT(t->entries, t->entry_count, tecmp1); for (i = 0; i < t->entry_count; i++) { if (t->entries[i]->versions[v].mode) |