Re: [PATCH] Remove duplicate pathspecs from ls-files command line
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 30, 2007, 01:25 UTC
- Message-ID
- <7vr6llak4h.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <85tzqic9bf.fsf@lola.goethe.zz>
David Kastrup <dak@gnu.org> writes:
> Does anything speak against sorting the pathspecs? That is an O(n log > n) operation,
Not sorting is O(0) operation without losing cycles for the normal case. I think you can sort first in that error handling path to avoid O(n^2) but sorting upfront to remove duplicates for every case is unnecessary bloat that penalizes sane callers.