upload-pack: use priority queue in reachable() check
authorJeff King <peff@peff.net>
Tue, 11 Oct 2016 21:20:16 +0000 (17:20 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 11 Oct 2016 21:27:56 +0000 (14:27 -0700)
commit5411b10cef90377afc584fc2562f26ac051fc357
treef16a7ae8c389d2c8f6766a92c2e648cad4153bfb
parent8a36cd87b7c85a651ab388d403629865ffa3ba0d
upload-pack: use priority queue in reachable() check

Like a lot of old commit-traversal code, this keeps a
commit_list in commit-date order, and and inserts parents
into the list. This means each insertion is potentially
linear, and the whole thing is quadratic (though the exact
runtime depends on the relationship between the commit dates
and the parent topology).

These days we have a priority queue, which can do the same
thing with a much better worst-case time.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
upload-pack.c