From: Jeff King Date: Tue, 11 Apr 2017 10:10:10 GMT Subject: Re: [PATCH 02/12] grep: remove redundant regflags assignment under PCRE Message-ID: <20170411101010.fl437hkvidkkx54w@sigill.intra.peff.net> In-Reply-To: <20170408132506.5415-3-avarab@gmail.com> On Sat, Apr 08, 2017 at 01:24:56PM +0000, Ævar Arnfjörð Bjarmason wrote: > Remove a redundant assignment to the "regflags" variable. This > variable is only used for POSIX regular expression matching, not when > the PCRE library is used. > > This redundant assignment was added as a result of copy/paste > programming in commit 84befcd0a4 ("grep: add a grep.patternType > configuration setting", 2012-08-03). That commit modified already > working code in commit cca2c172e0 ("git-grep: do not die upon -F/-P > when grep.extendedRegexp is set.", 2011-05-09) which didn't assign to > regflags when under PCRE. > > Revert back to that behavior, more to reduce "wait this is used under > PCRE how?" confusion when reading the code, than to to save ourselves > trivial CPU cycles by removing one assignment. Right, this makes sense. I wondered if there might be an obscure case where we set the flag, but I couldn't find one. -Peff