grep: rewrite an if/else condition to avoid duplicate expression
[gitweb.git] / grep.c
diff --git a/grep.c b/grep.c
index 627ae3e3e816998e30ff771d4c12abd0a1627122..6325cafe73fe695d5bb04bc979d79917669255f4 100644 (file)
--- a/grep.c
+++ b/grep.c
@@ -442,11 +442,8 @@ static void compile_regexp(struct grep_pat *p, struct grep_opt *opt)
         * simple string match using kws.  p->fixed tells us if we
         * want to use kws.
         */
-       if (opt->fixed)
+       if (opt->fixed || is_fixed(p->pattern, p->patternlen))
                p->fixed = !icase || ascii_only;
-       else if ((!icase || ascii_only) &&
-                is_fixed(p->pattern, p->patternlen))
-               p->fixed = 1;
        else
                p->fixed = 0;