aboutsummaryrefslogtreecommitdiff
path: root/fast-import.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 /fast-import.c
parentdbc540c7a5827529a3f58befc9e5b81a31ec8fab (diff)
downloadgit-9ed0d8d6e6de7737fe9a658446318b86e57c6fad.tar.gz
git-9ed0d8d6e6de7737fe9a658446318b86e57c6fad.tar.xz
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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fast-import.c b/fast-import.c
index bf53ac95d..cb545d7df 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)