Skip to content

Commit 695f95b

Browse files
pcloudsgitster
authored andcommitted
grep.c: reuse "icase" variable
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b51a9c1 commit 695f95b

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

grep.c

+1-4
Original file line numberDiff line numberDiff line change
@@ -454,10 +454,7 @@ static void compile_regexp(struct grep_pat *p, struct grep_opt *opt)
454454
p->fixed = 0;
455455

456456
if (p->fixed) {
457-
if (opt->regflags & REG_ICASE || p->ignore_case)
458-
p->kws = kwsalloc(tolower_trans_tbl);
459-
else
460-
p->kws = kwsalloc(NULL);
457+
p->kws = kwsalloc(icase ? tolower_trans_tbl : NULL);
461458
kwsincr(p->kws, p->pattern, p->patternlen);
462459
kwsprep(p->kws);
463460
return;

0 commit comments

Comments
 (0)