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>
Chandra Pratap committed
Aug 1, 2024 at 16:29 UTC
2e707447e127c9da3736fe7fa4943640078cc97d
2 files changed
+1
-2
reftable/pq.h
-1
@@ -22,7 +22,6 @@ struct merged_iter_pqueue {
22
size_t cap;
23
};
24
25
-void merged_iter_pqueue_check(struct merged_iter_pqueue pq);
25
struct pq_entry merged_iter_pqueue_remove(struct merged_iter_pqueue *pq);
26
void merged_iter_pqueue_add(struct merged_iter_pqueue *pq, const struct pq_entry *e);
27
void merged_iter_pqueue_release(struct merged_iter_pqueue *pq);
t/unit-tests/t-reftable-pq.c
+1
-1
@@ -10,7 +10,7 @@ https://developers.google.com/open-source/licenses/bsd
10
#include "reftable/constants.h"
11
#include "reftable/pq.h"
12
13
-void merged_iter_pqueue_check(struct merged_iter_pqueue pq)
13
+static void merged_iter_pqueue_check(struct merged_iter_pqueue pq)
14
{
15
for (size_t i = 1; i < pq.len; i++) {
16
size_t parent = (i - 1) / 2;