From: David Kastrup Date: Wed, 29 Aug 2007 21:36:20 GMT Subject: Re: [PATCH] Remove duplicate pathspecs from ls-files command line Message-ID: <85tzqic9bf.fsf@lola.goethe.zz> In-Reply-To: <20070829211519.GE11824@steel.home> Alex Riesen writes: > Junio C Hamano, Wed, Aug 29, 2007 22:44:22 +0200: >> >> That loop is plain old O(n^2) that penalizes everybody. >> > > Maybe something in pathspec matching code could be reused to notice > the duplications? It has to go through all of them anyway... Does anything speak against sorting the pathspecs? That is an O(n log n) operation, and dup detection is trivial afterwards. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum