aboutsummaryrefslogtreecommitdiffstats
path: root/commit.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-07-22 14:27:51 -0700
committerJunio C Hamano <gitster@pobox.com>2025-07-22 14:27:52 -0700
commitb859ed88ed4224e01f6abbf380a4a22237b86de9 (patch)
tree99f1b972eee301a93f11b59bcc008f5f51f822bb /commit.h
parentRevert "Merge branch 'rs/pop-recent-commit-with-prio-queue' into next" (diff)
parentcommit: use prio_queue_replace() in pop_most_recent_commit() (diff)
downloadgit-b859ed88ed4224e01f6abbf380a4a22237b86de9.tar.gz
git-b859ed88ed4224e01f6abbf380a4a22237b86de9.zip
Merge branch 'rs/pop-recent-commit-with-prio-queue' into next
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.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/commit.h b/commit.h
index 70c870dae4..9630c076d6 100644
--- a/commit.h
+++ b/commit.h
@@ -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);