diff options
author | René Scharfe <l.s.r@web.de> | 2025-07-18 11:39:14 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2025-07-22 07:28:35 -0700 |
commit | 3d5091d232ea991a6a991c86e9fb000f5a9009a0 (patch) | |
tree | cbc48f1816bea87ac7f374d11029cfa1a725a0ff /commit.c | |
parent | d6ec08788e667d4f556e9c2d97bbd7adb7e582be (diff) |
prio-queue: add prio_queue_replace()
Add a function to replace the top element of the queue that basically
does the same as prio_queue_get() followed by prio_queue_put(), but
without the work by prio_queue_get() to rebalance the heap. It can be
used to optimize loops that get one element and then immediately add
another one. That's common e.g., with commit history traversal, where
we get out a commit and then put in its parents.
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
0 files changed, 0 insertions, 0 deletions