From: Paul Smith Date: Wed, 22 Aug 2018 12:42:20 GMT Subject: Re: [ANNOUNCE] Git v2.19.0-rc0 Message-ID: <814549a01074e89a4b26cb0cf13e4dddeb3a040a.camel@mad-scientist.net> In-Reply-To: <20180822030344.GA14684@sigill.intra.peff.net> On Tue, 2018-08-21 at 23:03 -0400, Jeff King wrote: > static inline int hashcmp(const unsigned char *sha1, const unsigned > char *sha2) > { > + assert(the_hash_algo->rawsz == 20); > return memcmp(sha1, sha2, the_hash_algo->rawsz); > } I'm not familiar with Git code, but for most environments assert() is a macro which is compiled out when built for "release mode" (whatever that might mean). If that's the case for Git too, then relying on assert() to provide a side-effect (even an optimizer hint side-effect) won't work and this will actually get slower when built for "release mode". Just a thought...