Re: [PATCH 2/9] strbuf: add strbuf_tolower function
- From
Kyle J. McKay <mackyle@gmail.com>
- Date
- May 23, 2014, 22:34 UTC
- Message-ID
- <6057662E-B230-40FB-AB98-3E94BA70C7C1@gmail.com>
- In-Reply-To
- <20140523200534.GD19088@sigill.intra.peff.net>
On May 23, 2014, at 13:05, Jeff King wrote:
Show 20 quoted lines
> On Thu, May 22, 2014 at 03:52:08PM -0700, Kyle J. McKay wrote: > >>> Christian brought this up elsewhere, and I agree it's probably >>> better to >>> work over the whole buffer, NULs included. I'm happy to re-roll >>> (or you >>> can just pick up the version of the patch in this thread), >> >> The only reason I brought up the code difference in the first place >> was that >> the comment was "This makes config's lowercase() function public" >> which made >> me expect to see basically the equivalent of replacing a "static" >> with an >> "extern", but actually the function being made public was a different >> implementation than config's lowercase() function. > > Yeah, sorry if it sounded like I was complaining about your review > elsewhere. I mostly found it amusing that I got two opposite-direction > reviews.
I didn't seem like complaining to me. I also was amused. :)
> I agree that clarifying the situation in the commit message is best, > and > I've done that in the version I just posted.
It looks great. And I suspect you're correct that a modern compiler would optimize the index-based version to be as efficient as the pointer arithmetic version.
--Kyle