Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/grep.c
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2017-06-30 01:22:20 +0300
committerJunio C Hamano <gitster@pobox.com>2017-06-30 20:06:24 +0300
commitb07ed4e532fa9492a53b7b510c45efd671f468a8 (patch)
tree7085c4533687bfdcad3d108b8c71804a506309e7 /grep.c
parent885ef80d399fa49404608f24598f5df571178603 (diff)
grep: remove redundant and verbose re-assignments to 0
Remove the redundant re-assignments of the fixed/pcre1/pcre2 fields to zero right after the entire struct has been set to zero via memset(...). See an earlier related cleanup commit e0b9f8ae09 ("grep: remove redundant regflags assignments", 2017-05-25) for an explanation of why the code was structured like this to begin with. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'grep.c')
-rw-r--r--grep.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/grep.c b/grep.c
index 86dc9b696f..7fcdaa0753 100644
--- a/grep.c
+++ b/grep.c
@@ -174,28 +174,18 @@ static void grep_set_pattern_type_option(enum grep_pattern_type pattern_type, st
/* fall through */
case GREP_PATTERN_TYPE_BRE:
- opt->fixed = 0;
- opt->pcre1 = 0;
- opt->pcre2 = 0;
break;
case GREP_PATTERN_TYPE_ERE:
- opt->fixed = 0;
- opt->pcre1 = 0;
- opt->pcre2 = 0;
opt->regflags |= REG_EXTENDED;
break;
case GREP_PATTERN_TYPE_FIXED:
opt->fixed = 1;
- opt->pcre1 = 0;
- opt->pcre2 = 0;
break;
case GREP_PATTERN_TYPE_PCRE:
- opt->fixed = 0;
#ifdef USE_LIBPCRE2
- opt->pcre1 = 0;
opt->pcre2 = 1;
#else
/*
@@ -205,7 +195,6 @@ static void grep_set_pattern_type_option(enum grep_pattern_type pattern_type, st
* "cannot use Perl-compatible regexes[...]".
*/
opt->pcre1 = 1;
- opt->pcre2 = 0;
#endif
break;
}