aboutsummaryrefslogtreecommitdiff
path: root/refs
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 /refs
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 'refs')
-rw-r--r--refs/files-backend.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 0709f60b8..d16feb19c 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -501,7 +501,7 @@ static void sort_ref_dir(struct ref_dir *dir)
if (dir->sorted == dir->nr)
return;
- qsort(dir->entries, dir->nr, sizeof(*dir->entries), ref_entry_cmp);
+ QSORT(dir->entries, dir->nr, ref_entry_cmp);
/* Remove any duplicates: */
for (i = 0, j = 0; j < dir->nr; j++) {