Merge branch 'rs/mergesort'

Make our mergesort implementation type-safe.

* rs/mergesort:
  mergesort: remove llist_mergesort()
  packfile: use DEFINE_LIST_SORT
  fetch-pack: use DEFINE_LIST_SORT
  commit: use DEFINE_LIST_SORT
  blame: use DEFINE_LIST_SORT
  test-mergesort: use DEFINE_LIST_SORT
  test-mergesort: use DEFINE_LIST_SORT_DEBUG
  mergesort: add macros for typed sort of linked lists
  mergesort: tighten merge loop
  mergesort: unify ranks loops
This commit is contained in:
Junio C Hamano
2022-08-03 13:36:09 -07:00
12 changed files with 134 additions and 199 deletions

View File

@ -26,6 +26,7 @@
#include "commit-reach.h"
#include "commit-graph.h"
#include "sigchain.h"
#include "mergesort.h"
static int transfer_unpack_limit = -1;
static int fetch_unpack_limit = -1;
@ -1025,6 +1026,13 @@ static int get_pack(struct fetch_pack_args *args,
return 0;
}
static int ref_compare_name(const struct ref *a, const struct ref *b)
{
return strcmp(a->name, b->name);
}
DEFINE_LIST_SORT(static, sort_ref_list, struct ref, next);
static int cmp_ref_by_name(const void *a_, const void *b_)
{
const struct ref *a = *((const struct ref **)a_);