summaryrefslogtreecommitdiff
path: root/grep.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2016-06-25 05:22:38 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-07-01 19:44:57 (GMT)
commit695f95ba5dc4ab44f327574f85c3ebe7ebf449b1 (patch)
tree6193e3f8b1c22b0b402dc21a9099d42fed1bb699 /grep.c
parentb51a9c1479645b3e0c7d5156d027a97a4bb87977 (diff)
downloadgit-695f95ba5dc4ab44f327574f85c3ebe7ebf449b1.zip
git-695f95ba5dc4ab44f327574f85c3ebe7ebf449b1.tar.gz
git-695f95ba5dc4ab44f327574f85c3ebe7ebf449b1.tar.bz2
grep.c: reuse "icase" variable
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'grep.c')
-rw-r--r--grep.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/grep.c b/grep.c
index 0e6511f..906406a 100644
--- a/grep.c
+++ b/grep.c
@@ -454,10 +454,7 @@ static void compile_regexp(struct grep_pat *p, struct grep_opt *opt)
p->fixed = 0;
if (p->fixed) {
- if (opt->regflags & REG_ICASE || p->ignore_case)
- p->kws = kwsalloc(tolower_trans_tbl);
- else
- p->kws = kwsalloc(NULL);
+ p->kws = kwsalloc(icase ? tolower_trans_tbl : NULL);
kwsincr(p->kws, p->pattern, p->patternlen);
kwsprep(p->kws);
return;