From 15c9e9dfb13a77d1d0798cd97cc5aafc856b077c Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 31 Oct 2026 13:52:38 -0700 Subject: Sort with git's QSORT QSORT skips a list of fewer than two entries, so an empty list's null base never reaches qsort, which is what cgit_qsort was written for. --- source/shared.h | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'source/shared.h') diff --git a/source/shared.h b/source/shared.h index 2bf305d..e22eb57 100644 --- a/source/shared.h +++ b/source/shared.h @@ -140,16 +140,4 @@ extern int cgit_valid_rev(const char *rev); */ extern int cgit_notes_ref_usable(const char *notes_ref); -/* - * qsort for a list that may be empty. C leaves a null base undefined even - * with nothing to sort, and glibc declares it nonnull, while the lists here - * stay null until their first entry. - */ -static inline void cgit_qsort(void *base, size_t n, size_t size, - int (*cmp)(const void *, const void *)) -{ - if (n) - qsort(base, n, size, cmp); -} - #endif // CGIT_SHARED_H -- cgit