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>
This commit is contained in:

committed by
Junio C Hamano

parent
36f8e7ed7d
commit
c18eecbe5c
@ -36,7 +36,7 @@ static int merged_iter_init(struct merged_iter *mi)
|
||||
.rec = rec,
|
||||
.index = i,
|
||||
};
|
||||
merged_iter_pqueue_add(&mi->pq, e);
|
||||
merged_iter_pqueue_add(&mi->pq, &e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -71,7 +71,7 @@ static int merged_iter_advance_nonnull_subiter(struct merged_iter *mi,
|
||||
return 0;
|
||||
}
|
||||
|
||||
merged_iter_pqueue_add(&mi->pq, e);
|
||||
merged_iter_pqueue_add(&mi->pq, &e);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user