]> git.ipfire.org Git - thirdparty/git.git/commit
grep.c: do "if (bool && memchr())" not "if (memchr() && bool)"
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Wed, 16 Feb 2022 00:00:38 +0000 (01:00 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 16 Feb 2022 02:00:50 +0000 (18:00 -0800)
commitae807d778f502c81ec55897ac6d1f42ef3a4e23b
tree63d0cea93f9e17d7b54a277a6e1f6788a76cd2d4
parent321ee43628c53d6050fb7fbc552332bab681f1a4
grep.c: do "if (bool && memchr())" not "if (memchr() && bool)"

Change code in compile_regexp() to check the cheaper boolean
"!opt->pcre2" condition before the "memchr()" search.

This doesn't noticeably optimize anything, but makes the code more
obvious and conventional. The line wrapping being added here also
makes a subsequent commit smaller.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
grep.c