On Tue, Jul 15, 2025 at 04:51:22PM +0200, René Scharfe wrote: > 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. Hmm. But surely we still need to rebalance the heap after adding an element? And indeed, we still call the new sift_down_root() function. But I guess we are getting away without the "bubble up" operation that put would do? So we are doing half as much work (but still big-O the same)? -Peff