Re: remove_duplicates() in builtin/fetch-pack.c is O(N^2)
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 22, 2012, 16:16 UTC
- Message-ID
- <7vwr445gy8.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20120521174525.GA22643@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> I don't think there is any reason we can't sort the list of heads, and > then we can get rid of the duplicates with an O(n) traversal, like the > (largely untested) patch below.
Yeah, I think the only case the order matters in fetch is the traditional "when multiple non-glob fetch refspecs are configured, only merge the first one" logic, but it kicks in a much higher layer and the order in this list should not have any effect on it.
Thanks.