René Scharfe <rene.scharfe@xxxxxxxxxxxxxx> writes: > Add the new flag "fixed" to struct grep_pat and set it if the pattern > is doesn't contain any regex control characters in addition to if the > flag -F/--fixed-strings was specified. > > This gives a nice speed up on msysgit, where regexec() seems to be > extra slow. Before (best of five runs): Thanks, and... > static void compile_regexp(struct grep_pat *p, struct grep_opt *opt) > { > - int err = regcomp(&p->regexp, p->pattern, opt->regflags); > + int err; > + > + if (opt->fixed || is_fixed(p->pattern)) > + p->fixed = 1; > + if (opt->regflags & REG_ICASE) > + p->fixed = 0; ... thanks again for being extra careful. That's why I *love* your patches. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html