walker: avoid quadratic list insertion in mark_complete
commit3bc7a05b1a78b850da94ca85267ca279489ce70f
authorRené Scharfe <l.s.r@web.de>
Thu, 21 Aug 2014 18:30:24 +0000 (21 20:30 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 25 Aug 2014 17:28:14 +0000 (25 10:28 -0700)
tree61b58b73800ac3a4cdf3753389306de887842a92
parente8d1dfe639f71dc957c30c1eaa82a3ef0010cd8e
walker: avoid quadratic list insertion in mark_complete

Similar to 16445242 (fetch-pack: avoid quadratic list insertion in
mark_complete), sort only after all refs are collected instead of while
inserting.  The result is the same, but it's more efficient that way.
The difference will only be measurable in repositories with a large
number of refs.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
walker.c