walker: avoid quadratic list insertion in mark_complete
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 <2da278a99b557fc93ddbed7517a413ad793e2e6a@web.de>
Acked-by: Jeff King <696e3fbcf235d40b6ea1ebd61c87cbea79d444e7@peff.net>
Signed-off-by: Junio C Hamano <a6723cc3f76163bf7adb636a73ac3b0ceb3e6b9b@pobox.com>

destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git