diff options
author | Bram Moolenaar <bram@vim.org> | 2013-05-21 14:03:00 +0200 |
---|---|---|
committer | Bram Moolenaar <bram@vim.org> | 2013-05-21 14:03:00 +0200 |
commit | 0236a058c1c18d2bf5fe0aebcf576fc7bfd3f646 (patch) | |
tree | 4f9a38e3715692441b3b2319f3c3440bd4f6539e | |
parent | 533f1fd16b667a5286ca16e0abd9c6488b1e5467 (diff) | |
download | vim-0236a058c1c18d2bf5fe0aebcf576fc7bfd3f646.tar.gz |
Problem: New regexp engine is slow.
Solution: Break out of the loop when the state list is empty.
-rw-r--r-- | src/regexp_nfa.c | 5 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c index ba3a0f49..8a0c2614 100644 --- a/src/regexp_nfa.c +++ b/src/regexp_nfa.c @@ -2951,6 +2951,11 @@ again: #ifdef NFA_REGEXP_DEBUG_LOG fprintf(debug, "\n-------------------\n"); #endif + /* + * If the state lists are empty we can stop. + */ + if (thislist->n == 0 && neglist->n == 0) + break; /* compute nextlist */ for (i = 0; i < thislist->n || neglist->n > 0; ++i) diff --git a/src/version.c b/src/version.c index e274ae80..8931d1d9 100644 --- a/src/version.c +++ b/src/version.c @@ -729,6 +729,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 988, +/**/ 987, /**/ 986, |