mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
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>
This commit is contained in:
committed by
Junio C Hamano
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]);
|
||||
|
||||
Reference in New Issue
Block a user