prune_remote(): sort delete_refs_list references en masse
commit6d6d06c9012e96d74e9ea7aeeb6ce6dcd1a11b0f
authorMichael Haggerty <mhagger@alum.mit.edu>
Tue, 25 Nov 2014 08:02:31 +0000 (25 09:02 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 25 Nov 2014 18:09:49 +0000 (25 10:09 -0800)
tree65c6b627c8431a64db21e08073bb90b902918851
parent28d3f214d12af4a3d7e625faf4bb0af6c735fa8b
prune_remote(): sort delete_refs_list references en masse

Inserting items into a list in sorted order is O(N^2) whereas
appending them unsorted and then sorting the list all at once is
O(N lg N).

string_list_insert() also removes duplicates, and this change loses
that functionality. But the strings in this list, which ultimately
come from a for_each_ref() iteration, cannot contain duplicates.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/remote.c