reftable/writer: drop Git-specific `QSORT()` macro
The reftable writer accidentally uses the Git-specific `QSORT()` macro. This macro removes the need for the caller to provide the element size, but other than that it's mostly equivalent to `qsort()`. Replace the macro accordingly to make the library usable outside of Git. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
9077923c8e
commit
d4a2159a78
|
|
@ -399,7 +399,8 @@ int reftable_writer_add_refs(struct reftable_writer *w,
|
|||
{
|
||||
int err = 0;
|
||||
|
||||
QSORT(refs, n, reftable_ref_record_compare_name);
|
||||
if (n)
|
||||
qsort(refs, n, sizeof(*refs), reftable_ref_record_compare_name);
|
||||
|
||||
for (size_t i = 0; err == 0 && i < n; i++)
|
||||
err = reftable_writer_add_ref(w, &refs[i]);
|
||||
|
|
@ -491,7 +492,8 @@ int reftable_writer_add_logs(struct reftable_writer *w,
|
|||
{
|
||||
int err = 0;
|
||||
|
||||
QSORT(logs, n, reftable_log_record_compare_key);
|
||||
if (n)
|
||||
qsort(logs, n, sizeof(*logs), reftable_log_record_compare_key);
|
||||
|
||||
for (size_t i = 0; err == 0 && i < n; i++)
|
||||
err = reftable_writer_add_log(w, &logs[i]);
|
||||
|
|
|
|||
Loading…
Reference in New Issue