From: Junio C Hamano Date: Thu, 30 Aug 2007 01:25:50 GMT Subject: Re: [PATCH] Remove duplicate pathspecs from ls-files command line Message-ID: <7vr6llak4h.fsf@gitster.siamese.dyndns.org> In-Reply-To: <85tzqic9bf.fsf@lola.goethe.zz> David Kastrup 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.