Skip to content

Commit 885ef80

Browse files
avargitster
authored andcommitted
grep: remove redundant "fixed" field re-assignment to 0
Remove the redundant re-assignment of the fixed field to zero right after the entire struct has been set to zero via memset(...). Unlike some nearby commits this pattern doesn't date back to the pattern described in e0b9f8a ("grep: remove redundant regflags assignments", 2017-05-25), instead it was apparently cargo-culted in 9ecedde ("Use kwset in grep", 2011-08-21). Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c7e3855 commit 885ef80

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

grep.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,8 +626,6 @@ static void compile_regexp(struct grep_pat *p, struct grep_opt *opt)
626626
has_null(p->pattern, p->patternlen) ||
627627
is_fixed(p->pattern, p->patternlen))
628628
p->fixed = !icase || ascii_only;
629-
else
630-
p->fixed = 0;
631629

632630
if (p->fixed) {
633631
p->kws = kwsalloc(icase ? tolower_trans_tbl : NULL);

0 commit comments

Comments
 (0)