From: Erik Faye-Lund Date: Mon, 04 Oct 2010 14:03:05 GMT Subject: Re: [PATCH/RFC v3 6/8] Add case insensitivity support when using git ls-files Message-ID: In-Reply-To: <20101004074916.GK24884@burratino> On Mon, Oct 4, 2010 at 9:49 AM, Jonathan Nieder wrote: > Johannes Sixt wrote: >> On Sonntag, 3. Oktober 2010, Thomas Adam wrote: > >>> It's a real shame about the code duplication here.  Can we not avoid >>> it just by doing: >>> >>> unsigned char c1 = (ignore_case) ? tolower(*match) : *match; >>> unisgned char c2 = (ignore_case) ? tolower(*name) : *name; >>> >>> I appreciate that to some it might look like perl golf, but... >> >> It has been discussed, and IIRC, the concensus was to keep the code >> duplication because this is an inner loop. > > Did anyone time it?  If it really is not dwarfed by other computation, > then how about (warning: ugly!) > I believe it was timed. I was the one who reacted on this the first time around, and I seem to remember that the performance impact was indeed significant. This function is used all the time when updating the index etc IIRC.