refs.c: add a function to sort a ref list, rather then sorting on add
authorJulian Phillips <redacted>
Tue, 17 Apr 2007 01:42:50 +0000 (02:42 +0100)
committerJunio C Hamano <redacted>
Wed, 18 Apr 2007 23:20:57 +0000 (16:20 -0700)
commitc774aab98ce6c5ef7aaacbef38da0a501eb671d4
treea3b39d2c91b4a506b9d490ead8faf0b812096ab1
parent6fb8e8f401a065bdffe379764871551e37a041a0
refs.c: add a function to sort a ref list, rather then sorting on add

Rather than sorting the refs list while building it, sort in one
go after it is built using a merge sort.  This has a large
performance boost with large numbers of refs.

It shouldn't happen that we read duplicate entries into the same
list, but just in case sort_ref_list drops them if the SHA1s are
the same, or dies, as we have no way of knowing which one is the
correct one.

Signed-off-by: Julian Phillips <redacted>
Acked-by: Linus Torvalds <redacted>
Signed-off-by: Junio C Hamano <redacted>
refs.c
git clone https://git.99rst.org/PROJECT