Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElijah Conners <business@elijahpepe.com>2022-09-15 06:37:34 +0300
committerJunio C Hamano <gitster@pobox.com>2022-09-15 21:32:37 +0300
commitc18eecbe5c44be4c23f978a3f1c74b802d26c277 (patch)
tree8445a2e5d824883730b870b29330a74f13d507ef /reftable/pq_test.c
parent36f8e7ed7d72d2ac73743c3c2226cceb29b32156 (diff)
reftable: use a pointer for pq_entry param
The speed of the merged_iter_pqueue_add() can be improved by using a pointer to the pq_entry struct, which is 96 bytes. Since the pq_entry param is worked directly on the stack and does not currently have a pointer to it, the merged_iter_pqueue_add() function is slightly slower. References to pq_entry in reftable have typically included pointers, such as both of the params for pq_less(). Since we are working with pointers in the pq_entry param, as keenly pointed out, the pq_entry param has also been made into a const since the contents of the pq_entry param are copied and not manipulated. Signed-off-by: Elijah Conners <business@elijahpepe.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reftable/pq_test.c')
-rw-r--r--reftable/pq_test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/reftable/pq_test.c b/reftable/pq_test.c
index 7de5e886f3..011b5c7502 100644
--- a/reftable/pq_test.c
+++ b/reftable/pq_test.c
@@ -46,7 +46,7 @@ static void test_pq(void)
.u.ref = {
.refname = names[i],
} } };
- merged_iter_pqueue_add(&pq, e);
+ merged_iter_pqueue_add(&pq, &e);
merged_iter_pqueue_check(pq);
i = (i * 7) % N;
} while (i != 1);