]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.1194 v7.3.1194
authorBram Moolenaar <Bram@vim.org>
Fri, 14 Jun 2013 20:33:51 +0000 (22:33 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 14 Jun 2013 20:33:51 +0000 (22:33 +0200)
Problem:    Yaml highlighting is slow.
Solution:   Tune the estimation of pattern failure chance.

src/regexp_nfa.c
src/version.c

index 7a335336d394a1ba7eab9471bf9dd0e9e7cb1e2f..5414465b570451fce2b8fbb03cc5e400cd3d5aa4 100644 (file)
@@ -4686,6 +4686,18 @@ failure_chance(state, depth)
            /* empty match works always */
            return 0;
 
+       case NFA_START_INVISIBLE:
+       case NFA_START_INVISIBLE_FIRST:
+       case NFA_START_INVISIBLE_NEG:
+       case NFA_START_INVISIBLE_NEG_FIRST:
+       case NFA_START_INVISIBLE_BEFORE:
+       case NFA_START_INVISIBLE_BEFORE_FIRST:
+       case NFA_START_INVISIBLE_BEFORE_NEG:
+       case NFA_START_INVISIBLE_BEFORE_NEG_FIRST:
+       case NFA_START_PATTERN:
+           /* recursive regmatch is expensive, use low failure chance */
+           return 5;
+
        case NFA_BOL:
        case NFA_EOL:
        case NFA_BOF:
@@ -5264,7 +5276,7 @@ nfa_regmatch(prog, start, submatch, m)
                    skip_lid = nextlist->id;
 #endif
                }
-               else if(state_in_list(thislist,
+               else if (state_in_list(thislist,
                                          t->state->out1->out->out, &t->subs))
                {
                    skip = t->state->out1->out->out;
index 7ca5094f8c30360690f33ba39cd1dd2cb8d22d72..0b88903fe8ebed6c49ac99e4b7ff20262b4dcb0e 100644 (file)
@@ -728,6 +728,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1194,
 /**/
     1193,
 /**/