From: René Scharfe Date: Fri, 05 Apr 2019 20:17:07 GMT Subject: Re: [PATCH 05/12] http: simplify parsing of remote objects/info/packs Message-ID: <85b12bbd-15a8-09a1-395b-dc1606ab34e7@web.de> In-Reply-To: <20190405181132.GA32401@sigill.intra.peff.net> Am 05.04.2019 um 20:11 schrieb Jeff King: > On Fri, Apr 05, 2019 at 12:41:27PM +0200, René Scharfe wrote: >> Parsing "P" and "pack-" together crosses logical token boundaries, >> but that I don't mind it here. > > Yeah, I was tempted to write: > > if (skip_prefix(data, "P ", &data) && > skip_prefix(data, "pack-", &data) && > ... > > but that felt a little silly. I dunno. I guess it is probably not any > less efficient, because we'd expect skip_prefix() and its loop to get > inlined here anyway. Didn't think of inlining. Clang unrolls the whole comparison (except on powerpc64), but the other compilers available at the Compiler Explorer website keep the consecutive calls separate: https://godbolt.org/z/7eTarV René