]> git.ipfire.org Git - thirdparty/git.git/blobdiff - stable-qsort.c
Merge branch 'en/fetch-negotiation-default-fix'
[thirdparty/git.git] / stable-qsort.c
index 6cbaf39f7b6ccbb265d77dd17d8c3146d629ca90..7ff12467cdbed54326e2209a39fda4ae68b02f36 100644 (file)
@@ -48,15 +48,9 @@ void git_stable_qsort(void *b, size_t n, size_t s,
                      int (*cmp)(const void *, const void *))
 {
        const size_t size = st_mult(n, s);
-       char buf[1024];
-
-       if (size < sizeof(buf)) {
-               /* The temporary array fits on the small on-stack buffer. */
-               msort_with_tmp(b, n, s, cmp, buf);
-       } else {
-               /* It's somewhat large, so malloc it.  */
-               char *tmp = xmalloc(size);
-               msort_with_tmp(b, n, s, cmp, tmp);
-               free(tmp);
-       }
+       char *tmp;
+
+       tmp = xmalloc(size);
+       msort_with_tmp(b, n, s, cmp, tmp);
+       free(tmp);
 }