carlosmn/libgit2 — comment on commit 9656377b5481680be279765c30b8c3fba35f4643
File: src/revwalk.c line 97
By peff:

On Sat, Mar 03, 2012 at 03:42:12PM -0800, Carlos Martín Nieto wrote:

> I tried to replace the main list with a priority queue, but got
> stumped at replacing `interesting()` as we need to look through the
> whole list to figure out if there's anything interesting left in
> there. I don't suppose it's a good idea to take the flags into
> consideration for the comparison function, as they change, so we'd
> have to pop until the list gets empty. Hopefully this will turn out to
> be more efficient overall.
>
> I'll see how the priority queue fares.

Yeah, I think that was where I got stuck on trying to rip out
commit_list from git.git. If it's literally just "look at every
element", then that's easy. Presumably your pqueue is stored as a heap,
and you can just iterate over the storage array. But if you need to
iterate in date order, then yeah, you'll have to do a special operation
on the heap (I have a feeling that it can be done without re-heapifying
over and over, but I'd have to think about it).

-Peff