diff options
author | Junio C Hamano <gitster@pobox.com> | 2025-07-28 12:02:34 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2025-07-28 12:02:34 -0700 |
commit | 0f6e5037d40db4768e8b61aea22c68c9711ce544 (patch) | |
tree | cf43012483aec4b0ac9d57080dd8c055b6cbf626 /commit.h | |
parent | e4ef0485fd78fcb05866ea78df35796b904e4a8e (diff) | |
parent | a79e3519d66671a408041dac8c56d99078de41f2 (diff) |
Merge branch 'rs/pop-recent-commit-with-prio-queue'
The pop_most_recent_commit() function can have quite expensive
worst case performance characteristics, which has been optimized by
using prio-queue data structure.
* rs/pop-recent-commit-with-prio-queue:
commit: use prio_queue_replace() in pop_most_recent_commit()
prio-queue: add prio_queue_replace()
commit: convert pop_most_recent_commit() to prio_queue
Diffstat (limited to 'commit.h')
-rw-r--r-- | commit.h | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -201,10 +201,10 @@ const char *repo_logmsg_reencode(struct repository *r, const char *skip_blank_lines(const char *msg); -/** Removes the first commit from a list sorted by date, and adds all - * of its parents. - **/ -struct commit *pop_most_recent_commit(struct commit_list **list, +struct prio_queue; + +/* Removes the first commit from a prio_queue and adds its parents. */ +struct commit *pop_most_recent_commit(struct prio_queue *queue, unsigned int mark); struct commit *pop_commit(struct commit_list **stack); |