t-reftable-pq: make merged_iter_pqueue_check() static

merged_iter_pqueue_check() is a function previously defined in
reftable/pq_test.c (now t/unit-tests/t-reftable-pq.c) and used in
the testing of a priority queue as defined by reftable/pq.{c, h}.
As such, this function is only called by reftable/pq_test.c and it
makes little sense to expose it to non-testing code via reftable/pq.h.

Hence, make this function static and remove its prototype from
reftable/pq.h.

Mentored-by: Patrick Steinhardt <ps@pks.im>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Chandra Pratap 2024-08-01 16:29:45 +05:30 committed by Junio C Hamano
parent a08ea27cd0
commit 2e707447e1
2 changed files with 1 additions and 2 deletions

View File

@ -22,7 +22,6 @@ struct merged_iter_pqueue {
size_t cap;
};
void merged_iter_pqueue_check(struct merged_iter_pqueue pq);
struct pq_entry merged_iter_pqueue_remove(struct merged_iter_pqueue *pq);
void merged_iter_pqueue_add(struct merged_iter_pqueue *pq, const struct pq_entry *e);
void merged_iter_pqueue_release(struct merged_iter_pqueue *pq);

View File

@ -10,7 +10,7 @@ https://developers.google.com/open-source/licenses/bsd
#include "reftable/constants.h"
#include "reftable/pq.h"
void merged_iter_pqueue_check(struct merged_iter_pqueue pq)
static void merged_iter_pqueue_check(struct merged_iter_pqueue pq)
{
for (size_t i = 1; i < pq.len; i++) {
size_t parent = (i - 1) / 2;